imapclient icon indicating copy to clipboard operation
imapclient copied to clipboard

imapclient.fixed_offset.FixedOffset cannot be unpickled

Open freddrake opened this issue 6 years ago • 1 comments

With a pickled imapclient.fixed_offset.FixedOffset timezone with an offset of datetime.timedelta(0), unpickling raises an exception:

TypeError: __init__() missing 1 required positional argument: 'minutes'

I can work around this by adapting the timestamps returned for INTERNALDATE to use datetime.timezone instances instead of FixedOffset instances, but this shouldn't be necessary.

freddrake avatar Oct 03 '19 16:10 freddrake

Bummer. It should be fairly straightforward to allow FixedOffset instances to be unpickled.

Additionally, when running on Python 3, IMAPClient should probably be using datetime.timezone instead of FixedOffset.

mjs avatar Oct 19 '19 09:10 mjs