question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multiple conflicting time zone configurations

See original GitHub issue

Running on Ubuntu 16.04 I’m getting this error with tzlocal >= 4.0.1

Python 3.8.3 (default, Sep  2 2020, 09:15:06) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from tzlocal import get_localzone
>>> get_localzone()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/dispo/test_pytz/lib/python3.8/site-packages/tzlocal/unix.py", line 205, in get_localzone
    _cache_tz = _get_localzone()
  File "/home/dispo/test_pytz/lib/python3.8/site-packages/tzlocal/unix.py", line 167, in _get_localzone
    tzname = _get_localzone_name(_root)
  File "/home/dispo/test_pytz/lib/python3.8/site-packages/tzlocal/unix.py", line 146, in _get_localzone_name
    raise utils.ZoneInfoNotFoundError(message)
tzlocal.utils.ZoneInfoNotFoundError: 'Multiple conflicting time zone configurations found:\n/etc/timezone: America/Denver\n/etc/sysconfig/clock: America/Denver\n/usr/share/zoneinfo/Navajo: Navajo\nFix the configuration, or set the time zone in a TZ environment variable.\n'```

cat /etc/timezone America/Denver

cat /etc/sysconfig/clock ZONE=“America/Denver” UTC=false ARC=false


I don't know why it's checking /usr/share/zoneinfo/Navajo?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:17 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
regebrocommented, Oct 29, 2021

OK, no new issues for a few days, I released this as 4.1.

1reaction
regebrocommented, Oct 28, 2021

@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 localize() you use the replace() function on the datetime to make a naive datetime into a timezone aware one, and you no longer need to call normalize() after converting to another timezone.

https://pytz-deprecation-shim.readthedocs.io/en/latest/migration.html has more information on the differences. But there is no panic in doing this, I won’t drop the pytz shim for at least a year, probably longer since I’m lazy.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Timezone Information Missing in pytz? - Stack Overflow
I'm having a very weird problem with Python's pytz : it seems to have an incomplete catalog of timezones on my system (MacOS...
Read more >
Time zones and synchronisation - UpCloud
Configuring the time zone and synchronisation is an important but often overlooked part of maintaining Cloud Servers.
Read more >
Configure the time zone (TZ) on Linux systems
If you have multiple systems in different time zones, then UTC would be the best zone to use. This way all systems use...
Read more >
Handling Timezones in a Spring Boot Application - Reflectoring
It is common to encounter applications that run in different time zones. Handling date and time operations consistently across multiple ...
Read more >
zoneinfo — IANA time zone support — Python 3.11.1 ...
Compile-time configuration¶. The default TZPATH includes several common deployment locations for the time zone database (except on Windows, where there are no “ ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found