ShaderFallback / KindleOutlookCalendarWeather

standAlone
MIT License
56 stars 6 forks source link

报错 'No time zone found with key Etc/GMT' #12

Closed Chenhy2357 closed 1 month ago

Chenhy2357 commented 3 months ago

运行后,在log.log中报错 Traceback (most recent call last): File "/mnt/us/extensions/KindleOutlookCalendarWeather/bin/pytz_deprecation_shim/_impl.py", line 39, in timezone zone = _compat.get_timezone(key) File "/mnt/us/extensions/KindleOutlookCalendarWeather/bin/pytz_deprecation_shim/_compat_py3.py", line 16, in get_timezone return zoneinfo.ZoneInfo(key) File "/mnt/us/python3/lib/python3.9/zoneinfo/_common.py", line 24, in load_tzdata raise ZoneInfoNotFoundError(f"No time zone found with key {key}") zoneinfo._common.ZoneInfoNotFoundError: 'No time zone found with key Etc/GMT' 用 echo $TZ查询后时区是Asia/Shanghai,该如何解决

ShaderFallback commented 3 months ago

看报错描述是没有正常获取到时区,可以尝试修改下默认时区值,找到 KindleOutlookCalendarWeather\bin\tzlocal\unix.py 文件,166 行附近 tzname = "Etc/GMT" 修改为 tzname = "Asia/Shanghai"