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: time.strftime breakage in 2.4/2.5
Type: Stage:
Components: Library (Lib) Versions: Python 2.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: brett.cannon Nosy List: brett.cannon, skip.montanaro
Priority: normal Keywords:

Created on 2006-07-12 01:52 by skip.montanaro, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg29142 - (view) Author: Skip Montanaro (skip.montanaro) * (Python triager) Date: 2006-07-12 01:52
Up to Python 2.3 this worked just fine:

    >>> import time
    >>> time.strftime("%Y-%m-%d", (2005, 6, 4) + (0,)*6)
    '2005-06-04'

Starting with 2.4 it broke:

    >>> import time
    >>> time.strftime("%Y-%m-%d", (2005, 6, 4) + (0,)*6)
    Traceback (most recent call last):
      File "<stdin>", line 1, in ?
    ValueError: day of year out of range

though if you change the unused fields to 1 it works:

    >>> time.strftime("%Y-%m-%d", (2005, 6, 4) + (1,)*6)
    '2005-06-04'

While this wasn't documented behavior, it was certainly behaviour that 
worked for a long time.  It should probably be allowed to continue 
working.

Skip
msg29143 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2006-07-18 04:42
Logged In: YES 
user_id=357491

Fixed in rev. 50696 .
History
Date User Action Args
2022-04-11 14:56:18adminsetgithub: 43656
2006-07-12 01:52:59skip.montanarocreate