diff options
author | Victor Stinner <vstinner@python.org> | 2022-02-07 23:24:09 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-07 23:24:09 (GMT) |
commit | 7a0486eaa98083e0407ff491872db6d7a0da2635 (patch) | |
tree | 6c8a06ae69a8caac5e4a2717f4f083f97a798dd5 /Doc | |
parent | 7ba1cc8049fbcb94ac039ab02522f78177130588 (diff) | |
download | cpython-7a0486eaa98083e0407ff491872db6d7a0da2635.zip cpython-7a0486eaa98083e0407ff491872db6d7a0da2635.tar.gz cpython-7a0486eaa98083e0407ff491872db6d7a0da2635.tar.bz2 |
bpo-46659: calendar uses locale.getlocale() (GH-31166)
The calendar.LocaleTextCalendar and calendar.LocaleHTMLCalendar
classes module now use locale.getlocale(), instead of using
locale.getdefaultlocale(), if no locale is specified.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/calendar.rst | 2 | ||||
-rw-r--r-- | Doc/whatsnew/3.11.rst | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/Doc/library/calendar.rst b/Doc/library/calendar.rst index b667c42..86f5b14 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -290,7 +290,7 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is .. note:: The :meth:`formatweekday` and :meth:`formatmonthname` methods of these two - classes temporarily change the current locale to the given *locale*. Because + classes temporarily change the ``LC_TIME`` locale to the given *locale*. Because the current locale is a process-wide setting, they are not thread-safe. diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst index c1f267a..5738745 100644 --- a/Doc/whatsnew/3.11.rst +++ b/Doc/whatsnew/3.11.rst @@ -591,6 +591,12 @@ Changes in the Python API of sorting simply isn't well-defined in the absence of a total ordering on list elements. +* :mod:`calendar`: The :class:`calendar.LocaleTextCalendar` and + :class:`calendar.LocaleHTMLCalendar` classes now use + :func:`locale.getlocale`, instead of using :func:`locale.getdefaultlocale`, + if no locale is specified. + (Contributed by Victor Stinner in :issue:`46659`.) + Build Changes ============= |