This is LocaleTextCalendar.__init__ def __init__(self, firstweekday=0, locale=None): TextCalendar.__init__(self, firstweekday) if locale is None: locale = locale.getdefaultlocale() self.locale = locale Which can not work, obviosly ... let me hilight the important part if locale is None: locale = locale.getdefaultlocale() ??? Attached is a patch that corrects this and keeps the signature of the method with the locale=None keyword.
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.
I've applied my patch in r58936 (trunk) and r58937 (2.5 branch). I'm assigning the bug to Walter. Maybe he is able to shed some light on the prweek() issue. $ svn ann Lib/calendar.py | grep self\.week 43483 walter.doerwald print self.week(theweek, width),