Christian Heimes added the comment:
My patch uses "import locale as _locale" to avoid ambiguous variables.
It also fixes some additional bugs. I still don't understand how
prweek() should work. self.week is missing.
----------
keywords: +patch
nosy: +tiran
priority: -> normal
versions: +Python 2.6, Python 3.0
Added file: http://bugs.python.org/file8736/calendar.diff
__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1427>
__________________________________
--- /usr/lib/python2.5/calendar.py~ 2007-11-04 02:44:03.000000000 +0100
+++ /usr/lib/python2.5/calendar.py 2007-11-04 02:49:10.000000000 +0100
@@ -502,9 +502,11 @@
def __init__(self, firstweekday=0, locale=None):
TextCalendar.__init__(self, firstweekday)
- if locale is None:
- locale = locale.getdefaultlocale()
- self.locale = locale
+ lok = locale
+ if lok is None:
+ import locale
+ lok = locale.getdefaultlocale()
+ self.locale = lok
def formatweekday(self, day, width):
with TimeEncoding(self.locale) as encoding:
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com