timeutils parse_isotime adds tzinfo to ISO strings with no timezone
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
oslo.utils |
Confirmed
|
Medium
|
Unassigned |
Bug Description
It appears as though timeutils.
Observed with oslo_utils 3.17.0, python 2.7.12+:
>>> import datetime
>>> from oslo_utils import timeutils
>>> now_no_tz = datetime.
>>> print(now_no_tz)
2016-10-31 20:27:57.846308
>>> print(now_
None
>>> now_iso = now_no_
>>> print(now_iso)
2016-10-
>>> timeutils.
datetime.
>>> now_no_tz
datetime.
This is not compliant with ISO8601, which indicates that a "Z" must follow the datetime string if the timezone is UTC. Otherwise, local time should be assumed. [0]
This behavior should probably be corrected or documented.
[0] https:/
Changed in oslo.utils: | |
status: | New → Confirmed |
importance: | Undecided → Medium |