Bug 1197791
| Summary: | tz.tzstr('EST5EDT') fails with AttributeError: 'str' object has no attribute 'read' | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Adrian Likins <alikins> |
| Component: | python-dateutil | Assignee: | Jef Spaleta <jspaleta> |
| Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 22 | CC: | gwync, jspaleta, python-sig, tomspur |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | python-dateutil-2.4.0-3.fc22 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2015-03-09 08:24:50 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 1183382 | ||
|
Description
Adrian Likins
2015-03-02 15:49:52 UTC
Looks like this only fails if a non-unicode string is used as the tzstr arg.
dateutil.tz.tzstr('EST5EDT')
FAILS
dateutil.tz.tzstr(u'EST5EDT')
PASSES
dateutil.parser._timelex.__init__:35 seems to do it.
def __init__(self, instream):
if isinstance(instream, text_type):
instream = StringIO(instream)
self.instream = instream
The isinstance() check fails for a non unicode string.
>>> import six
>>> a = 'EST'
>>> isinstance(a, six.text_type)
False
>>> a = u'EST'
>>> isinstance(a, six.text_type)
True
So likely only fails on python2 with non unicode strings passed to tzstr()
python-dateutil-2.4.0-3.fc22 has been submitted as an update for Fedora 22. https://admin.fedoraproject.org/updates/python-dateutil-2.4.0-3.fc22 Package python-dateutil-2.4.0-3.fc22: * should fix your issue, * was pushed to the Fedora 22 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing python-dateutil-2.4.0-3.fc22' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2015-3147/python-dateutil-2.4.0-3.fc22 then log in and leave karma (feedback). python-dateutil-2.4.0-3.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report. |