Bug 1295709

Summary: python-tzlocal in EPEL 7 does not work with systemd, please update to version 1.2
Product: [Fedora] Fedora EPEL Reporter: Ralph Angenendt <ralph>
Component: python-tzlocalAssignee: Piotr Popieluch <piotr1212>
Status: CLOSED ERRATA QA Contact: Piotr Popieluch <piotr1212>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: epel7CC: info, piotr1212, ralph
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-tzlocal-1.2-2.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-01-24 01:05:53 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:

Description Ralph Angenendt 2016-01-05 10:21:27 UTC
Description of problem:

The version of python-tzlocal in EPEL 7 does not work with systemd, rendering it useless on RHEL 7 or CentOS 7.

This has been fixed in upstream, with version 1.2:

1.2 (2015-06-14)
----------------

- Systemd stores no time zone name, forcing us to look at the name of the file
  that localtime symlinks to. (cameris)

So please update python-tzlocal in EPEL to this version. 

Version-Release number of selected component (if applicable):

1.1.2-4

How reproducible:

Use python-tzlocal on RHEL 7

Steps to Reproduce:
Python 2.7.5 (default, Nov 20 2015, 02:00:19)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from tzlocal import get_localzone
>>> tz = get_localzone()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/tzlocal/unix.py", line 108, in get_localzone
    _cache_tz = _get_localzone()
  File "/usr/lib/python2.7/site-packages/tzlocal/unix.py", line 100, in _get_localzone
    return pytz.tzfile.build_tzinfo('local', tzfile)
  File "/usr/lib/python2.7/site-packages/pytz/tzfile.py", line 30, in build_tzinfo
    typecnt, charcnt) =  unpack(head_fmt, fp.read(head_size))
struct.error: unpack requires a string argument of length 44


Actual results:

python throws a stack trace.

Expected results:

As on RHEL 6:
Python 2.6.6 (r266:84292, Jul 22 2015, 16:47:47)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-16)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from tzlocal import get_localzone
>>> tz = get_localzone()
>>> print tz
Europe/Berlin
>>>

Additional info:

This has been fixed in upstream version 1.2:

1.2 (2015-06-14)
----------------

- Systemd stores no time zone name, forcing us to look at the name of the file
  that localtime symlinks to. (cameris)

Comment 1 Piotr Popieluch 2016-01-05 11:35:48 UTC
Thank you for reporting

Comment 2 Fedora Update System 2016-01-05 11:37:40 UTC
python-tzlocal-1.2-2.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-8434cdd00f

Comment 3 Fedora Update System 2016-01-05 11:41:19 UTC
python-tzlocal-1.2-1.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2016-8b4c6e8833

Comment 4 Fedora Update System 2016-01-05 23:26:24 UTC
python-tzlocal-1.2-2.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-8434cdd00f

Comment 5 Fedora Update System 2016-01-06 00:24:46 UTC
python-tzlocal-1.2-1.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-8b4c6e8833

Comment 6 Fedora Update System 2016-01-14 09:49:29 UTC
python-tzlocal-1.2-1.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2016-01-24 01:05:51 UTC
python-tzlocal-1.2-2.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.