[I picked up this bug as part of a Debian bugsquashing sprint together with my colleagues.]
Since there's been some back-and-forth in this thread, let me first summarize the status.
- The following will print an ugly warning:
In [1]: from dateutil import zoneinfo
In [2]: zoneinfo.get_zonefile_instance()
/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))
Out[2]: <dateutil.zoneinfo.ZoneInfoFile at 0x7f5810824bd0>
- It's just a warning, but it may confuse tools that consume stderr, or build
scripts may fail if anything is emitted on stderr.
- The warning can also be triggered by requesting a timezone that doesn't exist:
In [1]: from dateutil import tz In [2]: tz.gettz('foo')
/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)) - In this case, the warning is in fact
useless: if a timezone doesn't exist in the system database, it doesn't exist. -
Thus, the only case where the warning is relevant is when the bundled database
is used explicitly (by calling zoneinfo.get_zonefile_instance()).
However, this is not really a valid use case.
I conclude from this that all that really has to be done is to remove the
warning. Since the debian package doesn't have the bundled zoneinfo database,
it is not useful to issue a warning when there is no bundled zoneinfo database.
This bug is about the warning, not about the fact that the bundled zoninfo
database is missing.
Therefore, the attached patch removes the warning. This is done as part of
Remove_Zoneinfo_Tarball.patch because removing the database should really go
hand in hand with removing the warning. [Note that this is my first time
contribution to Debian packaging. I'm actually using Fedora myself :-). The
patch was tested by building it with pbuilder and running it in a bookworm
container. Please let me know if there is anything else I should do, or if there
is anything I should have done differently.] Regards, Arnout