Open hmaarrfk opened 2 hours ago
I can confirm that if you run:
sudo dpkg-reconfigure tzdata
and press enter twice, it will fix things..... somewhat annoying....
mark@carbon $ sudo dpkg-reconfigure tzdata
[sudo] password for mark:
Current default time zone: 'America/Los_Angeles'
Local time is now: Fri Sep 20 08:19:46 PDT 2024.
Universal Time is now: Fri Sep 20 15:19:46 UTC 2024.
✔ ~
mark@carbon $ echo "/etc/timezone $(cat /etc/timezone)" && ls -lah /etc/localtime
/etc/timezone America/Los_Angeles
lrwxrwxrwx 1 root root 39 Sep 20 08:13 /etc/localtime -> /usr/share/zoneinfo/America/Los_Angeles
I'm not sure if this is an ubuntu 24.04 bug or a tzlocal bug, but here are the steps to recreate
Then go to the Ubuntu date and time settings and uncheck automatic timezone and change the timezone to be something else
Then you can't import your code anymore because the
/etc/localtime
and/etc/timezone
conflict.Would it be OK to let
/etc/localtime
take precedence and make the error below a warning instead of an error? Setting environment variables is somewhat annoying.Thank you for the consideration
https://github.com/user-attachments/assets/a233bc66-246a-4d04-8ddf-911f08c7a36a
https://github.com/regebro/tzlocal/blob/52e53725f86fd74e551965de4e3a9f3aee826c8d/tzlocal/unix.py#L159
xref: https://github.com/regebro/tzlocal/issues/127