pyyaml
pyyaml copied to clipboard
Can't serialize ZoneInfo
trafficstars
In python 3.11, the serialization of
yaml.dump(zoneinfo.ZoneInfo("Europe/Paris"))
is:
tz: &id002 !!python/object/apply:None._unpickle
- Europe/Paris
- 1
However it can't be constructed back into a ZoneInfo object:
> yaml.unsafe_load(yaml.dump(zoneinfo.ZoneInfo("Europe/Paris")))
*** yaml.constructor.ConstructorError: while constructing a Python object
cannot find module 'None' (No module named 'None')
in "<unicode string>", line 1, column 1:
!!python/object/apply:None._unpickle
^
yaml.version is '6.0.2'