From daea9d21885e3bf532cfe2657e80e54fd54269af Mon Sep 17 00:00:00 2001 From: Alexey Izbyshev Date: Sun, 26 Aug 2018 23:55:31 +0300 Subject: [PATCH 1/2] bpo-34512: Document platform-specific strftime() behavior for non-ASCII format strings --- Doc/library/datetime.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst index 53c181c4014a9c..1a8e6088cb3d45 100644 --- a/Doc/library/datetime.rst +++ b/Doc/library/datetime.rst @@ -2029,6 +2029,12 @@ calls the platform C library's :func:`strftime` function, and platform variations are common. To see the full set of format codes supported on your platform, consult the :manpage:`strftime(3)` documentation. +Likewise, handling of format strings containing Unicode code points that can't +be represented in the charset of the current locale is platform-dependent. On +some platforms such code points are preserved intact in the output, while on +others ``strftime`` may raise :exc:`UnicodeError` or return an empty string +instead. + The following is a list of all the format codes that the C standard (1989 version) requires, and these work on all platforms with a standard C implementation. Note that the 1999 version of the C standard added additional From bca419315ba7336fa04d73bd8d5867f4e0c4daa3 Mon Sep 17 00:00:00 2001 From: Alexey Izbyshev Date: Thu, 27 Sep 2018 16:40:12 +0300 Subject: [PATCH 2/2] Fix wording based on review --- Doc/library/datetime.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst index 1a8e6088cb3d45..f52e5f15c8ea56 100644 --- a/Doc/library/datetime.rst +++ b/Doc/library/datetime.rst @@ -2029,11 +2029,11 @@ calls the platform C library's :func:`strftime` function, and platform variations are common. To see the full set of format codes supported on your platform, consult the :manpage:`strftime(3)` documentation. -Likewise, handling of format strings containing Unicode code points that can't -be represented in the charset of the current locale is platform-dependent. On -some platforms such code points are preserved intact in the output, while on -others ``strftime`` may raise :exc:`UnicodeError` or return an empty string -instead. +For the same reason, handling of format strings containing Unicode code points +that can't be represented in the charset of the current locale is also +platform-dependent. On some platforms such code points are preserved intact in +the output, while on others ``strftime`` may raise :exc:`UnicodeError` or return +an empty string instead. The following is a list of all the format codes that the C standard (1989 version) requires, and these work on all platforms with a standard C