Bug 784431
| Summary: | isodate formatting of datetime instances with local timezone fails | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Jason Connor <jconnor> | ||||||
| Component: | python-isodate | Assignee: | James Laska <jlaska> | ||||||
| Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||
| Severity: | medium | Docs Contact: | |||||||
| Priority: | unspecified | ||||||||
| Version: | rawhide | CC: | jlaska, jmatthew, jturner, mmccune | ||||||
| Target Milestone: | --- | ||||||||
| Target Release: | --- | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Linux | ||||||||
| Whiteboard: | |||||||||
| Fixed In Version: | python-isodate-0.4.7-1.fc16 | Doc Type: | Bug Fix | ||||||
| Doc Text: | Story Points: | --- | |||||||
| Clone Of: | Environment: | ||||||||
| Last Closed: | 2012-02-08 02:27:09 UTC | Type: | --- | ||||||
| Regression: | --- | Mount Type: | --- | ||||||
| Documentation: | --- | CRM: | |||||||
| Verified Versions: | Category: | --- | |||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||
| Embargoed: | |||||||||
| Attachments: |
|
||||||||
|
Description
Jason Connor
2012-01-24 22:03:34 UTC
Created attachment 557330 [details]
patch that detects None datetime instance and substitutes now()
should be submitted upstream
Thanks for the bug report. Surprisingly, I'm not incredibly familiar with the isodate codebase, but from what I can tell, with or without the provided patch, the result is unchanged.
# python -c 'import isodate ; isodate.strftime(isodate.LOCAL, "%Y")'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "isodate/isostrf.py", line 207, in strftime
return _strfdt(tdt, format, yeardigits)
File "isodate/isostrf.py", line 182, in _strfdt
format)
File "/usr/lib64/python2.7/re.py", line 151, in sub
return _compile(pattern, flags).sub(repl, string, count)
File "isodate/isostrf.py", line 179, in repl
return STRF_DT_MAP[match.group(0)](tdt, yeardigits)
File "isodate/isostrf.py", line 97, in <lambda>
(('%%0%dd' % yds) % tdt.year),
AttributeError: 'LocalTimezone' object has no attribute 'year'
I'm likely not triggering the failure you've reported. Can you supply the reproducer? And yes, this suggested patch should likely go upstream. I can help with that in this bug report if you like.
Created attachment 557487 [details]
quick python script that demonstrates the bug
python-isodate-0.4.7-1.fc16 has been submitted as an update for Fedora 16. https://admin.fedoraproject.org/updates/FEDORA-2012-0889/python-isodate-0.4.7-1.fc16 Package python-isodate-0.4.7-1.fc16: * should fix your issue, * was pushed to the Fedora 16 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing python-isodate-0.4.7-1.fc16' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2012-0889/python-isodate-0.4.7-1.fc16 then log in and leave karma (feedback). python-isodate-0.4.7-1.fc16 has been pushed to the Fedora 16 stable repository. If problems still persist, please make note of it in this bug report. |