有人可以帮助我解决这个问题吗?我正在尝试获取AWS RSS信息并将其提供给Zabbix。
usr / lib / python2.7 / site-packages / dateutil / parser / _parser.py:1204:UnknownTimezoneWarning:tzname PDT已识别,但无法理解。传递
tzinfos
参数,以正确返回时区感知日期时间。在将来的版本中,这将引发异常。 category = UnknownTimezone警告)
来自_parser.py:
def _build_tzaware(self, naive, res, tzinfos):
if (callable(tzinfos) or (tzinfos and res.tzname in tzinfos)):
tzinfo = self._build_tzinfo(tzinfos, res.tzname, res.tzoffset)
aware = naive.replace(tzinfo=tzinfo)
aware = self._assign_tzname(aware, res.tzname)
elif res.tzname and res.tzname in time.tzname:
aware = naive.replace(tzinfo=tz.tzlocal())
# Handle ambiguous local datetime
aware = self._assign_tzname(aware, res.tzname)
# This is mostly relevant for winter GMT zones parsed in the UK
if (aware.tzname() != res.tzname and
res.tzname in self.info.UTCZONE):
aware = aware.replace(tzinfo=tz.tzutc())
elif res.tzoffset == 0:
aware = naive.replace(tzinfo=tz.tzutc())
elif res.tzoffset:
aware = naive.replace(tzinfo=tz.tzoffset(res.tzname, res.tzoffset))
elif not res.tzname and not res.tzoffset:
# i.e. no timezone information was found.
aware = naive
elif res.tzname:
# tz-like string was parsed but we don't know what to do
# with it
warnings.warn("tzname {tzname} identified but not understood. "
"Pass `tzinfos` argument in order to correctly "
"return a timezone-aware datetime.