Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
ValueError when formatting time-zone to one that dose not exist in TZ environment variable.
# TZ=EST python -c 'import time;print time.strptime("Tue May 10 15:42:40 EST 2011", "%a %b %d %H:%M:%S %Z %Y")'
time.struct_time(tm_year=2011, tm_mon=5, tm_mday=10, tm_hour=15, tm_min=42, tm_sec=40, tm_wday=1, tm_yday=130, tm_isdst=0)
# TZ=GMT python -c 'import time;print time.strptime("Tue May 10 15:42:40 EST 2011", "%a %b %d %H:%M:%S %Z %Y")'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib64/python2.6/_strptime.py", line 454, in _strptime_time
return _strptime(data_string, format)[0]
File "/usr/lib64/python2.6/_strptime.py", line 325, in _strptime
(data_string, format))
ValueError: time data 'Tue May 10 15:42:40 EST 2011' does not match format '%a %b %d %H:%M:%S %Z %Y'
Version-Release number of selected component (if applicable):
python-2.6.6-20.el6.x86_64
How reproducible:
100%
Steps to Reproduce:
1.
2.
3.
Actual results:
Expected results:
strptime %Z should be able to format any time-zone.
Additional info:
Quoting http://docs.python.org/library/time.html#time.strptime
"Support for the %Z directive is based on the values contained in tzname and whether daylight is true. Because of this, it is platform-specific except for recognizing UTC and GMT which are always known (and are considered to be non-daylight savings timezones)."
You may want to look at the python-dateutil package; in particular, dateutil.parser.parse
Comment 3RHEL Program Management
2011-07-01 21:55:12 UTC
Development Management has reviewed and declined this request. You may appeal
this decision by reopening this request.
(In reply to comment #5)
> Since the component specifies vdsm, please also specify where in vdsm does this
> bug occur.
On vdsm startup:
reproduce step:
/etc/init.d/vdsmd restart && tail -f /var/log/vdsm/vdsm.log | grep -A 10 --color ERROR
Thread-18::ERROR::2011-07-04 11:16:44,865::caps::206::root::(kernelDict) kernel build time not found
Traceback (most recent call last):
File "/usr/share/vdsm/caps.py", line 204, in kernelDict
t = time.mktime(time.strptime(t, '%a %b %d %H:%M:%S %Z %Y'))
File "/usr/lib64/python2.6/_strptime.py", line 454, in _strptime_time
return _strptime(data_string, format)[0]
File "/usr/lib64/python2.6/_strptime.py", line 325, in _strptime
(data_string, format))
ValueError: time data 'Fri Jun 10 10:54:26 EDT 2011' does not match format '%a %b %d %H:%M:%S %Z %Y'
caps.py + 204
t = time.mktime(time.strptime(t, '%a %b %d %H:%M:%S %Z %Y'))
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
http://rhn.redhat.com/errata/RHEA-2011-1782.html
Description of problem: ValueError when formatting time-zone to one that dose not exist in TZ environment variable. # TZ=EST python -c 'import time;print time.strptime("Tue May 10 15:42:40 EST 2011", "%a %b %d %H:%M:%S %Z %Y")' time.struct_time(tm_year=2011, tm_mon=5, tm_mday=10, tm_hour=15, tm_min=42, tm_sec=40, tm_wday=1, tm_yday=130, tm_isdst=0) # TZ=GMT python -c 'import time;print time.strptime("Tue May 10 15:42:40 EST 2011", "%a %b %d %H:%M:%S %Z %Y")' Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/lib64/python2.6/_strptime.py", line 454, in _strptime_time return _strptime(data_string, format)[0] File "/usr/lib64/python2.6/_strptime.py", line 325, in _strptime (data_string, format)) ValueError: time data 'Tue May 10 15:42:40 EST 2011' does not match format '%a %b %d %H:%M:%S %Z %Y' Version-Release number of selected component (if applicable): python-2.6.6-20.el6.x86_64 How reproducible: 100% Steps to Reproduce: 1. 2. 3. Actual results: Expected results: strptime %Z should be able to format any time-zone. Additional info: