Closed Andrioden closed 2 years ago
This is because you have two configurations that sort of conflict (but only sort of), you both have an /etc/localtime that is a symlink to /usr/share/zoneinfo/UCT, but you also have an /etc/timezone with a configuration, that says "UTC".
Now, of course, UCT and UTC is the same, but I forgot about UCT, and the code I have looking for synonyms isn't including that one. I'll fix that. Also /usr/share/zoneinfo/UCT is usually a link to /usr/share/zoneinfo/Etc/UTC, which also would have avoided this specific issue, but apparently this isn't the case on your system.
Hmm, I dont complete overview of our projects code, env and build atm, but I want to reply quickly: If so I am going to guess this conflict lies in the public docker image python:3.9.6-buster
which makes me think tzlocal is better off solving it, which it sounds like you are!
I am ready to upgrade our reference, and test this if you push any updates tonight.
I released a 4.0.1b1 with this fix, see if that fixes it.
Works!
Any chance you release as well? So I can remove the pinned dependency. : >
I'll wait a bit to see if anything else pops up.
I started to see my CI pipelines failing. Luckily Google brought me here (how cool is that :laughing: ). A library I'm using (RESTInstance) is depending on tzlocal
16:12:26.026 | FAIL | ZoneInfoNotFoundError: 'Multiple conflicting time zone configurations found:
\n/etc/timezone: Etc/UTC\n/usr/share/zoneinfo/UCT: UCT\nFix the configuration,
or set the time zone in a TZ environment variable.\n' |
Traceback (most recent call last):
File "/home/circleci/.local/lib/python3.8/site-packages/REST/keywords.py", line 394, in get
return self._request(endpoint, request, validate)["response"]
File "/home/circleci/.local/lib/python3.8/site-packages/REST/keywords.py", line 1358, in _request
get_localzone()
File "/home/circleci/.local/lib/python3.8/site-packages/tzlocal/unix.py", line 205, in get_localzone
_cache_tz = _get_localzone()
File "/home/circleci/.local/lib/python3.8/site-packages/tzlocal/unix.py", line 167, in _get_localzone
tzname = _get_localzone_name(_root)
File "/home/circleci/.local/lib/python3.8/site-packages/tzlocal/unix.py", line 146, in _get_localzone_name
raise utils.ZoneInfoNotFoundError(message)
I'll try updating to tzlocal 4.0.1b1
tzlocal 4.0.1b1 fixed my issue.
Cool. I had no idea UCT was such a popular spelling. :-)
OK, I released 4.0.1.
@Andrioden & @wlad I think what you had was actually the same issue as this: https://github.com/regebro/tzlocal/issues/122
Turns out plenty of Linux distributions does not link aliases like UCT to the correct file: UTC, instead they link them backwards. I do not know why.
I released a 4.1b1 that I think will fix this, it would be cool if one of you could test it.
Summary
Our project uses dateparses, which again depends on
tzlocal
. After auto-upgrading our packages, and therunder tzlocal from 3.0 to 4.0 our build started failing. Its either that or related to your dependencypytz-deprecation-shim
.When i pinned our build to tzlocal = 3.0, the problem went away.
Details
Other things:
Our code
Exception