Skip to content

iso8601: FixedOffset objects can not be unpickled #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wschaub
Copy link
Contributor

@wschaub wschaub commented Aug 1, 2014

This patch replaces the init of FixedOffset with a set method
instead. This is so we can unpickle datetime objects using this tzinfo
based class as a tzinfo= argument. you can read all about it at
https://docs.python.org/2/library/datetime.html#tzinfo-objects

I ran into this while trying to unpickle a pickled dictionary filled with
UrlSetElement objects that I had read in from the sitemap library which
had a lastmod set in the parsed sitemap you get a nasty traceback
complaining about init requiring 4 arguments but only one given with
out much useful info on what inside the pickle file caused it.

This patch replaces the __init__ of FixedOffset with a set method
instead. This is so we can unpickle datetime objects using this tzinfo
based class as a tzinfo= argument. you can read all about it at
https://docs.python.org/2/library/datetime.html#tzinfo-objects

I ran into this while trying to unpickle a pickled dictionary filled with
UrlSetElement objects that I had read in from the sitemap library which
had a lastmod set in the parsed sitemap you get a nasty traceback
complaining about __init__ requiring 4 arguments but only one given with
out much useful info on what inside the pickle file caused it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant