Skip to content

Conversation

@bolkedebruin
Copy link
Contributor

@bolkedebruin bolkedebruin commented Nov 14, 2017

Python's doc say: "A tzinfo subclass must have an init() method that can
be called with no arguments". TimezoneInfo doesn't honor this
requirement. Defining getinitargs is sufficient to fix copy/deepcopy as
well as pickling/unpickling.

This is #134 implemented

@bolkedebruin bolkedebruin force-pushed the add_deepcopy branch 4 times, most recently from 8e7c033 to 070a02f Compare November 15, 2017 19:57
@bolkedebruin bolkedebruin force-pushed the add_deepcopy branch 2 times, most recently from 24bfa11 to 2da9108 Compare November 15, 2017 20:07
@bolkedebruin
Copy link
Contributor Author

bolkedebruin commented Nov 15, 2017

@sdispater Can you please take a look? We (Airflow) could definitely use a release with this patch added.

Python's doc say: "A tzinfo subclass must have an __init__() method that can
be called with no arguments". Timezone and TimezoneInfo don't honor this
requirement. Defining __getinitargs__ is sufficient to fix copy/deepcopy as
well as pickling/unpickling.

This introduces __tzinfos to Timezone as otherwise recursion errors will happen
due to TimezoneInfo having a reference to Timezone.
@sdispater
Copy link
Collaborator

@bolkedebruin Looks good to me 👍

I will merge this and make a new bugfix release later today.

@bolkedebruin
Copy link
Contributor Author

That’s much appreciated!

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.

2 participants