sigmavirus24/github3.py — pull request #234 by bgilbert (2014-05-01 19:35:42+00:00)
Title: Make datetime properties timezone-aware

GitHub returns timestamps in UTC (thus the trailing `Z`). `GitHubObject._strptime()` was returning a timezone-naive datetime, which had the numerical value of the original timestamp but no timezone. As a result, these datetimes did not unambiguously represent a single point in time.

Change `_strptime()` to return a timezone-aware datetime in UTC. Since the Python datetime module provides no concrete timezone classes, implement our own to avoid a trivial dependency on an external library.

Because naive and aware datetimes aren't very compatible -- they can't be compared with each other, stringify to different formats, etc. -- this change will be somewhat painful for library users. But it's the right thing to do, and will only get harder over time.