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.

Author serhiy.storchaka
Recipients belopolsky, lemburg, serhiy.storchaka
Date 2015-03-20.11:19:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1426850371.96.0.168304833853.issue23717@psf.upfronthosting.co.za>
In-reply-to
Content
strptime() with year-weekday pair can produce invalid data.

>>> time.strptime('2015 0', '%Y %w')
time.struct_time(tm_year=2015, tm_mon=1, tm_mday=1, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=6, tm_yday=1, tm_isdst=-1)
>>> time.strptime('2015 1', '%Y %w')
time.struct_time(tm_year=2015, tm_mon=1, tm_mday=1, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=0, tm_yday=1, tm_isdst=-1)
>>> time.strptime('2015 2', '%Y %w')
time.struct_time(tm_year=2015, tm_mon=1, tm_mday=1, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=1, tm_yday=1, tm_isdst=-1)
>>> time.strptime('2015 3', '%Y %w')
time.struct_time(tm_year=2015, tm_mon=1, tm_mday=1, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=1, tm_isdst=-1)
>>> time.strptime('2015 4', '%Y %w')
time.struct_time(tm_year=2015, tm_mon=1, tm_mday=1, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=3, tm_yday=1, tm_isdst=-1)
>>> time.strptime('2015 5', '%Y %w')
time.struct_time(tm_year=2015, tm_mon=1, tm_mday=1, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=4, tm_yday=1, tm_isdst=-1)
>>> time.strptime('2015 6', '%Y %w')
time.struct_time(tm_year=2015, tm_mon=1, tm_mday=1, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=5, tm_yday=1, tm_isdst=-1)

You get Jan 1 with any weekday.
History
Date User Action Args
2015-03-20 11:19:32serhiy.storchakasetrecipients: + serhiy.storchaka, lemburg, belopolsky
2015-03-20 11:19:31serhiy.storchakasetmessageid: <1426850371.96.0.168304833853.issue23717@psf.upfronthosting.co.za>
2015-03-20 11:19:31serhiy.storchakalinkissue23717 messages
2015-03-20 11:19:31serhiy.storchakacreate