[New-bugs-announce] [issue13674] crash in datetime.strftime

patrick vrijlandt report at bugs.python.org
Thu Dec 29 10:04:17 CET 2011

New submission from patrick vrijlandt <patrick.vrijlandt at gmail.com>:

This causes a crash in python 3.2.2 and 3.2, but not in 2.7.2

Python 3.2 (r32:88445, Feb 20 2011, 21:29:02) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import datetime
>>> datetime.datetime(1899,12,31).strftime("%y")

The crash happens with %y but not with %Y.
The crash happens with any year < 1900.
On 2.7.2 a ValueError is raised because strftime requires year >= 1900. This is what IMHO should happen (and would have saved me a lot of time)

components: Library (Lib)
messages: 150323
nosy: patrick.vrijlandt
priority: normal
severity: normal
status: open
title: crash in datetime.strftime
type: crash
versions: Python 3.2

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list