Skip to content
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

Dicts from parsed datetime with a timezone cannot be deep-copied #308

Closed
jpsca opened this issue Aug 7, 2020 · 3 comments
Closed

Dicts from parsed datetime with a timezone cannot be deep-copied #308

jpsca opened this issue Aug 7, 2020 · 3 comments

Comments

@jpsca
Copy link
Contributor

jpsca commented Aug 7, 2020

The resulting dict from parsing a datetime with a timezone cannot be deep-copied using
the stdlib function copy.deepcopy().

Example

import copy
import toml

o = toml.loads("dob = 1979-05-27T07:32:00-08:00")
copy.deepcopy(o)

What happens now

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

What should happen

The dict is copied and the timezone of the copy has the same offset but it is a different object.

@seperman
Copy link

I'm running into the same issue too.

@seperman
Copy link

I see you have a commit in your own fork @jpsca

@jpsca
Copy link
Contributor Author

jpsca commented Sep 29, 2020

Yes, and I made a PR with the fix: #309

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

No branches or pull requests

2 participants