Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
1755 Vistas

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
Descartar
Mejor respuesta

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
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
0
ene 25
1147
4
abr 24
3049
1
abr 24
2301
5
abr 24
2910
1
jun 23
7995