Alexander Belopolsky <belopol...@users.sourceforge.net> added the comment:

Note that a recently closed issue 7150 similarly tightened up datetime 
operations by making out of range dates raise OverflowError rather than produce 
non-sensible result.  This case is not a clear cut, but now with timezone.utc 
available in datetime module, I believe users should be encouraged to use 
t.astimezone(timezone.utc) to produce UTC time.  If timetuple is required the 
later can be converted using timetuple() method.  Idelally, t.utctimetuple() 
should be deprecated in favor of more explicit 
t.astimezone(timezone.utc).timetuple().  Unfortunately the two expressions are 
subtly different because 

>>> t = datetime.max.replace(tzinfo=timezone.min)
>>> t.astimezone(timezone.utc)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OverflowError: date value out of range

----------
nosy: +gvanrossum

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue9005>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to