Author vstinner
Recipients vstinner
Date 2018-12-12.10:43:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
It seems like bpo-31339 introduced a regression with commit eeadf5fc231163ec97a8010754d9c995c7c14876 to fix a security issue.

Copy of of bencordova's comment from GitHub:

I'm new at commenting on this project so apologies if this is not the appropriate place to do so.

From what I can see (upgrading from python 2.7.13->2.7.15), the string format on line 648 of Modules/timemodule.c causes a different output from time.ctime() and time.asctime(t) for "days of the month < 10"

"%s %s%3d %.2d:%.2d:%.2d %d"

The "%3d" in this change removes the leading zero on the tm_mday but maintains a leading space.

Just looking for feedback on what the intention was and if this is a bug.

python 2.7.13:

>>> import time
>>> t = time.strptime("6 Dec 18", "%d %b %y")
>>> time.asctime(t)
'Thu Dec 06 00:00:00 2018'

python 2.7.15:

>>> import time
>>> t = time.strptime("6 Dec 18", "%d %b %y")
>>> time.asctime(t)
'Thu Dec  6 00:00:00 2018'

Note, the string with this change includes two spaces between "Dec" and "6" which also looks awkward.

Original Post:
Date User Action Args
2018-12-12 10:43:18vstinnersetrecipients: + vstinner
2018-12-12 10:43:18vstinnersetmessageid: <>
2018-12-12 10:43:18vstinnerlinkissue35469 messages
2018-12-12 10:43:18vstinnercreate