[issue23332] datetime.isoformat() -> explicitly mark UTC string as such

Alexander Belopolsky report at bugs.python.org
Tue Jan 27 20:09:44 CET 2015


Alexander Belopolsky added the comment:

What is your specific proposal?

As I explained, we cannot assume that naive timezone instances are in UTC because while sometimes they are (as in datetime.utcnow()), more often they are not (as in datetime.now()).  So changing dt.isoformat() when dt is naive is wrong.

Another alternative would be to return aware instances from utcnow(), but that would break a lot of code.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23332>
_______________________________________


More information about the Python-bugs-list mailing list