python_dateutil get_zonefile_instance functionality is broken without upstream tarball

Bug #1887664 reported by Chris MacNaughton
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-dateutil (Ubuntu)
Incomplete
Medium
Unassigned
Groovy
Won't Fix
Medium
Unassigned
python-sqlalchemy-utils (Ubuntu)
Incomplete
Medium
Unassigned
Groovy
Won't Fix
Medium
Unassigned

Bug Description

python-dateutil expects to have 'dateutil-zoneinfo.tar.gz' in it's directory tree, but this file is removed in the packaging. This is trivially demonstrated using the package version versus the pip version:

Package version:

>>> from dateutil.zoneinfo import get_zonefile_instance
>>> get_zonefile_instance().zones.get('America/Los_Angeles') is None
/usr/lib/python3/dist-packages/dateutil/zoneinfo/__init__.py:26: UserWarning: I/O error(2): No such file or directory
  warnings.warn("I/O error({0}): {1}".format(e.errno, e.strerror))
True

Pip version:

>>> from dateutil.zoneinfo import get_zonefile_instance
>>> get_zonefile_instance().zones.get('America/Los_Angeles') is None
False
>>> get_zonefile_instance().zones.get('America/Los_Angeles')
tzfile('US/Pacific')

This causes sqlalchemy_utils' date functionality to be broken when paired with dateutils as it relies on this functionality. python-dateutil should be updated to include this tarball, or should be updated to fallback on the tzdata package for timezone information for this use case

ProblemType: Bug
DistroRelease: Ubuntu 20.10
Package: python3-dateutil 2.8.1-4
ProcVersionSignature: Ubuntu 5.4.0-37.41-generic 5.4.41
Uname: Linux 5.4.0-37-generic x86_64
NonfreeKernelModules: algif_hash af_alg binfmt_misc veth nft_masq nft_chain_nat bridge stp llc zfs zunicode zavl icp zcommon znvpair spl zlua ebtable_filter ebtables ip6table_raw ip6table_mangle ip6table_nat ip6table_filter ip6_tables iptable_raw iptable_mangle iptable_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 iptable_filter bpfilter nf_tables nfnetlink unix_diag softdog overlay nls_iso8859_1 dm_multipath scsi_dh_rdac scsi_dh_emc scsi_dh_alua kvm_intel input_leds joydev kvm serio_raw sch_fq_codel drm ip_tables x_tables autofs4 btrfs zstd_compress raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor raid6_pq libcrc32c raid1 raid0 multipath linear hid_generic usbhid crct10dif_pclmul crc32_pclmul hid virtio_net ghash_clmulni_intel net_failover failover aesni_intel crypto_simd psmouse cryptd glue_helper virtio_blk floppy
ApportVersion: 2.20.11-0ubuntu42
Architecture: amd64
CasperMD5CheckResult: skip
Date: Wed Jul 15 12:06:24 2020
Ec2AMI: ami-00000b08
Ec2AMIManifest: FIXME
Ec2AvailabilityZone: nova
Ec2InstanceType: m1.xlarge
Ec2Kernel: unavailable
Ec2Ramdisk: unavailable
PackageArchitecture: all
ProcEnviron:
 TERM=screen-256color
 PATH=(custom, no user)
 LANG=C.UTF-8
SourcePackage: python-dateutil
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Chris MacNaughton (chris.macnaughton) wrote :
James Page (james-page)
Changed in python-sqlalchemy-utils (Ubuntu):
status: New → Triaged
Changed in python-dateutil (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Changed in python-sqlalchemy-utils (Ubuntu):
importance: Undecided → Medium
tags: added: rls-gg-incoming
tags: removed: rls-gg-incoming
tags: added: id-5f19ab2b0f81fa20ab8d8346
Revision history for this message
Tiago Stürmer Daitx (tdaitx) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better.

Is there any reason why 'dateutil.tz' can't be used instead of dateutil.zoneinfo? The original bug report was made against python-sqlalchemy-utils, which seems to indicate that some functionatility of it might be making use of dateutil.zoneinfo instead of dateutil.tz.

Some context:
python-dateutil’s zoneinfo tarball is not included in the binary package since 1.4.1-1ubuntu2 (from 28 Sep 2008) [1].

The dateutil.zoneinfo is expected to use the shipped tarball instead of the system’s tzdata. Unfortunately shipping copies zoneinfo data goes against Debian and Ubuntu policies - specially for outdated copies. See the original bug report for that in Debian [2].

The usual way to access timezone data is by relying on dateutil.tz: it is designed to use the system's zoneinfo first, with dateutil.zoneinfo as a fallback. Debian and Ubuntu ship tzdata with current zoneinfo, thus the dateutil.zoneinfo code is never used - it seems it is there basically for Windows, since Windows provides no API for timezone data.

On a side note: PEP 615 [3] has been approved for Python 3.9 and so python-dateutil will no longer be required in the future - there’s also some plans to include it as a backport for 3.6+.

Bug will be marked as incomplete while we wait for more information. Feel free to reply back and change its status after updating the report.

Thanks!

References:
[1] https://launchpad.net/ubuntu/+source/python-dateutil/1.4-1ubuntu2
[2] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=416204
[3] https://www.python.org/dev/peps/pep-0615/

Changed in python-dateutil (Ubuntu Groovy):
status: Triaged → Incomplete
Changed in python-sqlalchemy-utils (Ubuntu Groovy):
status: Triaged → Incomplete
tags: added: fr-117
Revision history for this message
Brian Murray (brian-murray) wrote :

The Groovy Gorilla has reached end of life, so this bug will not be fixed for that release

Changed in python-dateutil (Ubuntu Groovy):
status: Incomplete → Won't Fix
Changed in python-sqlalchemy-utils (Ubuntu Groovy):
status: Incomplete → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.