summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-10-19 18:54:25 (GMT)
committerGeorg Brandl <georg@python.org>2010-10-19 18:54:25 (GMT)
commit7004bd1a3de06330761d164bae0d82c597bf39cf (patch)
tree4c27a09a59a559026e5f1cf157df2573fbdb9304 /Doc/library
parentf87cc0448158fedad9ba0a1edcec3664d9f90eb4 (diff)
downloadcpython-7004bd1a3de06330761d164bae0d82c597bf39cf.zip
cpython-7004bd1a3de06330761d164bae0d82c597bf39cf.tar.gz
cpython-7004bd1a3de06330761d164bae0d82c597bf39cf.tar.bz2
#10092: Properly reset locale in Locale*Calendar classes. The context manager was buggy because setlocale() returns the *new* locale, not the old. Also add a test for this.
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/calendar.rst12
1 files changed, 9 insertions, 3 deletions
diff --git a/Doc/library/calendar.rst b/Doc/library/calendar.rst
index 2228920..c8dac49 100644
--- a/Doc/library/calendar.rst
+++ b/Doc/library/calendar.rst
@@ -170,9 +170,9 @@ it's the base calendar for all computations.
.. class:: LocaleTextCalendar(firstweekday=0, locale=None)
This subclass of :class:`TextCalendar` can be passed a locale name in the
- constructor and will return month and weekday names in the specified
- locale. If this locale includes an encoding all strings containing month and
- weekday names will be returned as unicode.
+ constructor and will return month and weekday names in the specified locale.
+ If this locale includes an encoding all strings containing month and weekday
+ names will be returned as unicode.
.. class:: LocaleHTMLCalendar(firstweekday=0, locale=None)
@@ -182,6 +182,12 @@ it's the base calendar for all computations.
locale. If this locale includes an encoding all strings containing month and
weekday names will be returned as unicode.
+.. note::
+
+ The :meth:`formatweekday` and :meth:`formatmonthname` methods of these two
+ classes temporarily change the current locale to the given *locale*. Because
+ the current locale is a process-wide setting, they are not thread-safe.
+
For simple text calendars this module provides the following functions.