You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pytz._FixedOffsetdoes define a localize() method, but it also explicitly setszone = None. (I'm not familiar enough with pytz, or datetime.tzinfo, conventions to have anything useful to say about whether this is surprising.)
FWIW, pendulum.UTC.convert() does handle pytz._FixedOffset properly. Unsure whether the fix is to reuse that same logic in _safe_timezone()?
Also, #158 did add some logic to handle pytz offsets, but it appears test cases using pytz.FixedOffset instances might have been removed?
The text was updated successfully, but these errors were encountered:
Linux-6.6.12-linuxkit-aarch64-with-glibc2.36
3.0.0
Issue
pendulum.instance()
errors if passed adatetime.datetime
wheretzinfo
is apytz._FixedOffset()
instance, e.g.The error seems to originate here:
pendulum/src/pendulum/__init__.py
Lines 110 to 111 in 3e3fec6
pytz._FixedOffset
does define alocalize()
method, but it also explicitly setszone = None
. (I'm not familiar enough withpytz
, ordatetime.tzinfo
, conventions to have anything useful to say about whether this is surprising.)FWIW,
pendulum.UTC.convert()
does handlepytz._FixedOffset
properly. Unsure whether the fix is to reuse that same logic in_safe_timezone()
?Also, #158 did add some logic to handle
pytz
offsets, but it appears test cases usingpytz.FixedOffset
instances might have been removed?The text was updated successfully, but these errors were encountered: