]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-28604: Fix localeconv() for different LC_MONETARY (GH-10606) (GH-10619) (GH-10621)
authorVictor Stinner <vstinner@redhat.com>
Tue, 20 Nov 2018 21:36:15 +0000 (22:36 +0100)
committerGitHub <noreply@github.com>
Tue, 20 Nov 2018 21:36:15 +0000 (22:36 +0100)
commitdf3051b53fd7f2862a4087f5449e811d8421347a
treebadd1540cbb45854912b5be63056e526d625eb04
parent7a0d964afb41bde846771c81ba746238339cdd8c
bpo-28604: Fix localeconv() for different LC_MONETARY (GH-10606) (GH-10619) (GH-10621)

locale.localeconv() now sets temporarily the LC_CTYPE locale to the
LC_MONETARY locale if the two locales are different and monetary
strings are non-ASCII. This temporary change affects other threads.

Changes:

* locale.localeconv() can now set LC_CTYPE to LC_MONETARY to decode
  monetary fields.
* Add LocaleInfo.grouping_buffer: copy localeconv() grouping string
  since it can be replaced anytime if a different thread calls
  localeconv().

(cherry picked from commit 02e6bf7f2025cddcbde6432f6b6396198ab313f4)
(cherry picked from commit 6eff6b8eecd7a8eccad16419269fa18ec820922e)
Doc/library/locale.rst
Misc/NEWS.d/next/Library/2018-11-20-13-34-01.bpo-28604.iiih5h.rst [new file with mode: 0644]
Modules/_localemodule.c
Python/fileutils.c
Python/formatter_unicode.c