A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2010-June/100670.html below:

[Python-Dev] Year 0 and year 10,000 in timetuple

[Python-Dev] Year 0 and year 10,000 in timetuple [Python-Dev] Year 0 and year 10,000 in timetupleAlexander Belopolsky alexander.belopolsky at gmail.com
Sat Jun 19 22:43:18 CEST 2010
While datetime range is limited to years from 1 through 9999, it is
possible to produce time tuple with year 0 or year 10,000:

>>> t1 = datetime.min.replace(tzinfo=timezone.max)
>>> t2 = datetime.max.replace(tzinfo=timezone.min)
>>> t1.utctimetuple().tm_year
0
>>> t2.utctimetuple().tm_year
10000

Most if not all functions consuming timetuples are not designed to
handle years beyond 9999 and such timetuples cannot be converted back
to datetime.

I would like to make utctimetuple() method to raise OverflowError on
values like t1 or t2 above.  These values are most certainly a mistake
in application ad it is better to detect them earlier before they make
their way into system functions that cannot handle them.

See issues 9005 and 6608 on the tracker.

http://bugs.python.org/issue9005
http://bugs.python.org/issue6608
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4