This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: email.utils.parsedate_to_datetime() handling of -0000 offset
Type: behavior Stage:
Components: email Versions: Python 3.10, Python 3.9
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: barry, fdrake, r.david.murray
Priority: normal Keywords:

Created on 2021-12-09 18:12 by fdrake, last changed 2022-04-11 14:59 by admin.

Messages (1)
msg408149 - (view) Author: Fred Drake (fdrake) (Python committer) Date: 2021-12-09 18:12
A local time offset of '-0000' is not handled the same way as an offset of '+0000', but I'd expect it would be:

>>> import email.utils
>>> 
>>> email.utils.parsedate_to_datetime('9 Dec 2021 08:52:04 -0000')
datetime.datetime(2021, 12, 9, 8, 52, 4)
>>> email.utils.parsedate_to_datetime('9 Dec 2021 08:52:04 +0000')
datetime.datetime(2021, 12, 9, 8, 52, 4, tzinfo=datetime.timezone.utc)

I observe the same behavior on Python 3.9.9 and 3.10.1.
History
Date User Action Args
2022-04-11 14:59:53adminsetgithub: 90185
2021-12-09 18:12:25fdrakecreate