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

Timezone information missing under python 3.5 #18

Closed
prymitive opened this issue Oct 30, 2016 · 4 comments
Closed

Timezone information missing under python 3.5 #18

prymitive opened this issue Oct 30, 2016 · 4 comments

Comments

@prymitive
Copy link

I've noticed that when I'm parsing timestamp with timezone information under python 3.5 project I'm getting timezone unaware datetime objects:

Python 2.7.12 (default, Sep 29 2016, 13:30:34) 
[...]
In [1]: import ciso8601

In [2]: t = ciso8601.parse_datetime('2014-01-09T21:48:00.921000+05:30')

In [3]: t.tzinfo
Out[3]: pytz.FixedOffset(330)
Python 3.5.1 (default, Sep 19 2016, 10:16:17) 
[...]
In [1]: import ciso8601

In [2]: t = ciso8601.parse_datetime('2014-01-09T21:48:00.921000+05:30')

In [3]: t.tzinfo

In [4]: type(t.tzinfo)
Out[4]: NoneType

Using ciso8601==1.0.2 in both cases. Tested on Fedora 24 with distro provided python binaries.

@prymitive
Copy link
Author

Hmm, I've added 3.5 to travis and can't seem to reproduce this - https://travis-ci.org/prymitive/ciso8601/jobs/171866331

@prymitive
Copy link
Author

I wanted to run tests with fedora docker image and noticed that pytz is installed when running tests. I've installed it in my virtualenv and now everything works. So this seems to be simply missed dependency which is mentioned in the README (I've missed that, sorry).

@thomasst
Copy link
Member

thomasst commented Nov 3, 2016

It should probably do a better job at failing in https://github.com/closeio/ciso8601/blob/master/module.c#L245

I think right now it leaves pytz_fixed_offset and pytz_utc uninitialized, which is bad.

@thomasst
Copy link
Member

thomasst commented Nov 3, 2016

Opened #19 to address this

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