datetime.now(tzlocal()).tzname() fails under Polish windows

Bug #1087306 reported by Jerzy Ludwichowski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dateutil
New
Undecided
Unassigned

Bug Description

Under Polish windows the following code

print datetime.now(tzlocal()).tzname()

crashes with

Traceback (most recent call last):
  File "test.py", line 14, in <module>
    print datetime.now(tzlocal()).tzname()
  File "c:\python26\lib\site-packages\dateutil\tz.py", line 39, in inner_func
    return myfunc(*args, **kwargs).encode()
UnicodeDecodeError: 'ascii' codec can't decode byte 0x8c in position 0: ordinal not in range(128)

Reason - the default ascii codec fails on the Polish name of the timezone:
 u"Środkowoeuropejski czas stand.".encode('cp1250')

description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.