Skip to content

Conversation

@vstinner
Copy link
Member

@vstinner vstinner commented Nov 20, 2018

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 anytimes if a different thread calls
    localeconv().
  • _Py_GetLocaleconvNumeric() now requires a "struct lconv *"
    structure, so locale.localeconv() now longer calls localeconv()
    twice. Moreover, the function now requires all arguments to be
    non-NULL.
  • Rename STATIC_LOCALE_INFO_INIT to LOCALE_INFO_STATIC_INIT.
  • Move _Py_GetLocaleconvNumeric() definition from fileutils.h
    to pycore_fileutils.h. pycore_fileutils.h now includes locale.h.
  • The _locale module is now built with Py_BUILD_CORE defined.

https://bugs.python.org/issue28604

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 anytimes if a different thread calls
  localeconv().
* _Py_GetLocaleconvNumeric() now requires a "struct lconv *"
  structure, so locale.localeconv() now longer calls localeconv()
  twice. Moreover, the function now requires all arguments to be
  non-NULL.
* Rename STATIC_LOCALE_INFO_INIT to LOCALE_INFO_STATIC_INIT.
* Move _Py_GetLocaleconvNumeric() definition from fileutils.h
  to pycore_fileutils.h. pycore_fileutils.h now includes locale.h.
* The _locale module is now built with Py_BUILD_CORE defined.
@vstinner
Copy link
Member Author

Once this change will be merged into master, I will write a smaller change for 3.7 and older Python versions since this change is a little bit too big to be backported.

@vstinner vstinner merged commit 02e6bf7 into python:master Nov 20, 2018
@vstinner vstinner deleted the lc_monetary branch November 20, 2018 15:20
vstinner added a commit that referenced this pull request Nov 20, 2018
…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 02e6bf7)
vstinner added a commit that referenced this pull request Nov 20, 2018
…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 02e6bf7)
(cherry picked from commit 6eff6b8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants