Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
1936 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
0
led 25
1327
4
dub 24
3372
1
dub 24
2544
5
dub 24
3152
1
čvn 23
8470