This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: LocaleTextCalendar and LocaleHTMLCalendar break without a locale
Type: crash Stage:
Components: Extension Modules Versions: Python 2.5
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: WoLpH, gpolo
Priority: normal Keywords:

Created on 2008-07-18 13:02 by WoLpH, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg69952 - (view) Author: WoLpH (WoLpH) Date: 2008-07-18 13:02
Steps to reproduce:
>>> import calendar
>>> calendar.LocaleHTMLCalendar()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.5/calendar.py", line 540, in __init__
    locale = locale.getdefaultlocale()
AttributeError: 'NoneType' object has no attribute 'getdefaultlocale'

The same goes for LocaleTextCalendar, the problem is caused by this 
code which obviously would never work:
if locale is None:
    locale = locale.getdefaultlocale()

The fix should be quite easy, rename the local variable and it will 
work again :)
msg69954 - (view) Author: Guilherme Polo (gpolo) * (Python committer) Date: 2008-07-18 13:13
This was fixed in r45302 and r58936
History
Date User Action Args
2022-04-11 14:56:36adminsetgithub: 47656
2008-07-18 13:13:33gpolosetstatus: open -> closed
resolution: out of date
messages: + msg69954
nosy: + gpolo
2008-07-18 13:02:51WoLpHcreate