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
Deepcopy on DateTimes occurs any time dataclass' module-level asdict is called on a dataclass object that contains DateTime objects, triggering this bug. asdict in turn is called by pydantic's json encoder function pydantic_encoder, which is how we found out about this in the first place.
The text was updated successfully, but these errors were encountered:
Issue also presents on python 3.10.1 and python 3.10.13
Issue
When passing a DateTime undergoing dst transition to standard deepcopy, the produced DateTime has an invalid offset.
Reproduction
Code
Output
Workaround
An ugly hack can be used to work around the issue:
Result:
Relevance
Deepcopy on DateTimes occurs any time dataclass' module-level
asdict
is called on a dataclass object that contains DateTime objects, triggering this bug.asdict
in turn is called by pydantic's json encoder functionpydantic_encoder
, which is how we found out about this in the first place.The text was updated successfully, but these errors were encountered: