-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple conflicting time zone configurations #122
Comments
Your /etc/localzone is a symlink to /usr/share/zoneinfo/Navajo. I should make that information clearer... |
Done. 4.0.2 released with a clearer error message in this case. |
This was an odd one. /etc/localtime was symlinked to /usr/share/zoneinfo/America/Denver. /usr/share/zoneinfo/America/Denver was symlinked to /usr/share/zoneinfo/Navajo. I don't know how that happened. I appear to be running the latest tzdata package in Ubuntu 16.04. I grabbed the correct timezone file off a newer system and everything works now. Thanks for the quick response and the better error message. |
Huh, yeah, that's odd, looking it up I see that Navajo should link to America/Denver, not the other way around. |
I'll pin this issue, and if there are more systems with these links backwards, I might have to look each config up. In this case, if I had checked if America/Denver was a symlink, you would have not gotten an error. On the other hand, tzlocal might then have returned "Navajo", which I guess also would be surprising. :-) |
Another one I think. :) Ubuntu 18.04
|
Yeah, looks like it. Why did they add those annoying links, like GB? :angry old man yells at cloud.gif: |
another:
also Ubuntu 18.04 This is a strange suggestion, but if /etc/timezone matches the name of the first-level symlink of /etc/localtime, maybe it would be the "correct" answer to return that, rather than following the second link? But yeah, it does seem like the links are backwards. Navajo, GB, and Israel, for example, appear in the https://data.iana.org/time-zones/code/backward file. Could it be that somehow the links were reversed? I think I'm out of my depth here; I got lost in the Makefile |
os.path.realpath() just returns the real path, any middle symlinks are hidden, so doing it that way will be tricky. But I think what I have is a good solution. I have released 4.1b1, please test it. |
looks good; works for me 👍 thanks! |
Cheers @regebro, also working for me though I now get this output:
|
Hah although I didn't clock that wasn't referring to your tzlocal package, my bad. Assume it's all fine. 👍 |
@davejennings That great! The warnings are expected. Are you explicitly using pytz? If not you may want to modify your code to use the standard datetime way of dealing with timezones instead. It's been updated to handle the cases that it could not handle earlier, so the pytz API isn't needed any more. IIRC (it's a year since I did this, I may misremember) instead of https://pytz-deprecation-shim.readthedocs.io/en/latest/migration.html has more information on the differences. |
There's another one:
|
@dakide Can you see if tzlocal==4.1b1 works for you? |
@regebro yes it does, thank you! |
OK, no new issues for a few days, I released this as 4.1. |
Solved by having |
Running on Ubuntu 16.04 I'm getting this error with tzlocal >= 4.0.1
cat /etc/timezone
America/Denver
cat /etc/sysconfig/clock
ZONE="America/Denver"
UTC=false
ARC=false
The text was updated successfully, but these errors were encountered: