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

UTC is not a BaseTzInfo instance? #10

Closed
jenstroeger opened this issue Mar 8, 2018 · 3 comments
Closed

UTC is not a BaseTzInfo instance? #10

jenstroeger opened this issue Mar 8, 2018 · 3 comments

Comments

@jenstroeger
Copy link

I am confused by the following behavior:

>>> import pytz
>>> pytz.__version__
'2018.3'
>>> utc = pytz.timezone('UTC')
>>> la = pytz.timezone('America/Los_Angeles')
>>> isinstance(utc, pytz.tzinfo.BaseTzInfo)
False
>>> isinstance(la, pytz.tzinfo.BaseTzInfo)
True

Is this intended, and if so, why?

Thanks!

@stub42
Copy link
Owner

stub42 commented Mar 13, 2018

It wasn't intentional, and should probably be fixed per https://bugs.launchpad.net/pytz/+bug/1696956

Its not completely trivial, due to the pickling optimizations being done for UTC.

@stub42 stub42 closed this as completed Mar 13, 2018
@jenstroeger
Copy link
Author

@stub42, yes that’s the same problem I’ve encountered in a very similar context, see the referenced issue kvesteri/sqlalchemy-utils#315. Any estimate as to when this will be fixed?

@jenstroeger
Copy link
Author

jenstroeger commented Apr 10, 2018

@stub42, looks like you’ve fixed it: https://git.launchpad.net/pytz/commit/?id=fae0ac547f40eed5a9cce27e0b53cfc2fadfaabe.

Its not completely trivial, due to the pickling optimizations being done for UTC.

Looks like it was indeed a simple fix! I’ll keep an eye out for the update! 👍🏽

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