pytz.timezone doesn't accept unicode timezone
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pytz |
Fix Released
|
High
|
Stuart Bishop |
Bug Description
When giving a unicode timezone to pytz.timezone(), it throws an exception.
>>> pytz.timezone(
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/
_tzinfo_
File "/usr/local/
_transition
TypeError: type() argument 1 must be string, not unicode
It certainly is easy to circumvent this, but it is annoying having to remember this special constraint as I am using unicode strings throughout the whole program.
Related branches
Changed in pytz: | |
importance: | Undecided → High |
Changed in pytz: | |
assignee: | nobody → Stuart Bishop (stub) |
status: | Triaged → Fix Committed |
Changed in pytz: | |
status: | Fix Committed → Fix Released |
This is a regression. Line 146 of pytz/__init__.py used to convert the timezone to ASCII, but this was changed to just confirm the timezone contained just ASCII characters. This was done because the older construct resulted in a bytestring under Python 3.x.