[issue3406] LocaleTextCalendar and LocaleHTMLCalendar break without a locale

WoLpH report at bugs.python.org
Fri Jul 18 15:02:52 CEST 2008


New submission from WoLpH <Rick.van.Hattem at Fawo.nl>:

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 :)

----------
components: Extension Modules
messages: 69952
nosy: WoLpH
severity: normal
status: open
title: LocaleTextCalendar and LocaleHTMLCalendar break without a locale
type: crash
versions: Python 2.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3406>
_______________________________________


More information about the Python-bugs-list mailing list