timeutils is not leap second safe
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
oslo.utils |
Fix Released
|
Low
|
Ihar Hrachyshka |
Bug Description
We are having a leap second in June: http://
It will mean we'll have 61 seconds at that moment. datetime module is not leap aware and will fail with "ValueError: second must be in 0..59" if seconds=60 is passed. The proper response to it would be to avoid using datetime and switch to time module that operates with struct_time objects.
The problem is that timeutils API is bound to datetime. Specifically, the following functions are affected:
- parse_strtime
- utcnow
- unmarshall_time
This may mean that we can't fix it as a bug, but may need to introduce new proper time API.
An easy way to check that we're affected is e.g.:
+ def test_unmarshall
+ leap_time = dict(day=30, month=6, year=2015,
+ hour=23, minute=59, second=60, microsecond=0)
+ leap_datetime = timeutils.
+
description: | updated |
Changed in oslo.utils: | |
status: | New → Confirmed |
importance: | Undecided → Low |
Changed in oslo.utils: | |
assignee: | nobody → Julien Danjou (jdanjou) |
Changed in oslo.utils: | |
milestone: | none → 2.8.0 |
status: | Fix Committed → Fix Released |
Fix c50d8161ac251ee 0c9cad6012bc7ce ab4f899d6f was merged , so we can close it now.