Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
1445 Ansichten

Whenever I'm commiting my code, I get this UnknownTimeZoneError: 'Europe/Kyiv'. If anyone knows whats the problem it would be great!


Traceback (most recent call last):

File "/home/odoo/src/odoo/odoo/addons/base/tests/test_tz.py", line 31, in test_tz_legacy

assertTZEqual(pytz.timezone(source), pytz.timezone(target))

File "/home/odoo/src/odoo/odoo/tools/_monkeypatches_pytz.py", line 129, in timezone

return original_pytz_timezone(name)

File "/usr/lib/python3/dist-packages/pytz/__init__.py", line 188, in timezone

raise UnknownTimeZoneError(zone)

pytz.exceptions.UnknownTimeZoneError: 'Europe/Kyiv'

Avatar
Verwerfen
Beste Antwort

Hello Shrut Pansuriya,

You can execute following script to list of available timezone.

with open(r'pytz_all_timezones.txt', 'w') as fp:
    for item in pytz.all_timezones:
        # write each item on a new line
        fp.write(f"{item}\n")

In your terminal go to specific folder, execute cmd python3.

type, import pytz

then write above script. It will create file of available timezone. 


You are facing this error because the timezone which you are trying to enter its not available in this library.

Avatar
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
0
Jan. 25
950
4
Apr. 24
2685
1
Apr. 24
1997
5
Apr. 24
2599
1
Juni 23
7587