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

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)
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