mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #9005: Prevent utctimetuple() from producing year 0 or year 10,000.
This commit is contained in:
parent
c56b094bab
commit
75f94c210a
4 changed files with 31 additions and 36 deletions
|
@ -974,10 +974,10 @@ Instance methods:
|
|||
``d.dst()`` returns. DST is never in effect for a UTC time.
|
||||
|
||||
If *d* is aware, *d* is normalized to UTC time, by subtracting
|
||||
``d.utcoffset()``, and a :class:`time.struct_time` for the normalized time is
|
||||
returned. :attr:`tm_isdst` is forced to 0. Note that the result's
|
||||
:attr:`tm_year` member may be :const:`MINYEAR`\ -1 or :const:`MAXYEAR`\ +1, if
|
||||
*d*.year was ``MINYEAR`` or ``MAXYEAR`` and UTC adjustment spills over a year
|
||||
``d.utcoffset()``, and a :class:`time.struct_time` for the
|
||||
normalized time is returned. :attr:`tm_isdst` is forced to 0. Note
|
||||
that an :exc:`OverflowError` may be raised if *d*.year was
|
||||
``MINYEAR`` or ``MAXYEAR`` and UTC adjustment spills over a year
|
||||
boundary.
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue