remove local iso8601 and use dependency #189
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When running some tests on another project I stumbled upon a failed
test that revealed a bug in colander's iso8601. If you try to
deserialize "2014-09-09T15:15:57.516967" into a datetime object you
get
datetime.datetime(2014, 9, 9, 15, 15, 57, 516966)
(notice themicroseconds are off by 1). I traced it down to this:
int(float("0.%s" % "516967") * 1e6)
is equal to 516966 due torounding.
I was going to fix it, but iso8601 is a currently maintained project
on pypi that has this issue (and possibly others) already fixed.
So, it makes much more sense to offload everything back to that project.
The only difference (besides the bug fixes) is following:
iso8601.Utc
=>iso8601.iso8601.Utc
iso8601.FixedOffset
=>iso8601.iso8601.FixedOffset
An iso8601.py is left for backwards compatibility for strange cases
where colander.iso8601 was imported (like deform).