pyyaml icon indicating copy to clipboard operation
pyyaml copied to clipboard

Can't serialize ZoneInfo

Open guillaumematheron opened this issue 1 year ago • 0 comments
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'

guillaumematheron avatar Aug 26 '24 12:08 guillaumematheron