[Bug 1887664] Re: python_dateutil get_zonefile_instance functionality is broken without upstream tarball

Tiago Stürmer Daitx 1887664 at bugs.launchpad.net
Mon Aug 31 19:42:09 UTC 2020


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/

** Bug watch added: Debian Bug tracker #416204
   https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=416204

** Changed in: python-dateutil (Ubuntu Groovy)
       Status: Triaged => Incomplete

** Changed in: python-sqlalchemy-utils (Ubuntu Groovy)
       Status: Triaged => Incomplete

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to python-dateutil in Ubuntu.
https://bugs.launchpad.net/bugs/1887664

Title:
  python_dateutil get_zonefile_instance functionality is broken without
  upstream tarball

Status in python-dateutil package in Ubuntu:
  Incomplete
Status in python-sqlalchemy-utils package in Ubuntu:
  Incomplete
Status in python-dateutil source package in Groovy:
  Incomplete
Status in python-sqlalchemy-utils source package in Groovy:
  Incomplete

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)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python-dateutil/+bug/1887664/+subscriptions



More information about the foundations-bugs mailing list