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 aganders3
Recipients AaronR, Alex.Willmer, BreamoreBoy, Erik Cederstrand, Erik.Cederstrand, aganders3, belopolsky, berker.peksag, r.david.murray, serhiy.storchaka, tim.peters
Date 2015-07-28.15:26:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1438097184.53.0.634307237445.issue12006@psf.upfronthosting.co.za>
In-reply-to
Content
Wow, I can't believe this issue is so old now! I'm motivated to finally come
back and address the remaining issues to get this merged. Sorry for seemingly
abandoning this; I'm embarrassed I didn't push to finish it earlier.

It sounds like the consensus is to raise a ValueError in cases where ambiguity
may arise, with specific suggestions for resolving the ambiguity in each case.
This is in contrast to certain other cases where strptime uses some default
value for missing data (e.g. month/day = 1, year = 1900).

Ambiguous or incomplete cases I have identified are:
1. ISO week (%V) is specified, but the year is specified with %Y instead of %G
2. ISO year (%G) and ISO week (%V) are specified, but a weekday is not
3. ISO year (%G) and weekday are specified, but ISO week (%V) is not
4. ISO year is specified alone (e.g. time.strptime('2015', '%G'))
5. Julian/ordinal day (%j) is specified with %G, but not %Y

Hopefully that covers it...let me know if I need to add any cases or change
behavior in any cases. I can have a patch (at least an initial attempt) ready
for this in the next few days.
History
Date User Action Args
2015-07-28 15:26:24aganders3setrecipients: + aganders3, tim.peters, belopolsky, r.david.murray, BreamoreBoy, Erik.Cederstrand, AaronR, berker.peksag, serhiy.storchaka, Erik Cederstrand, Alex.Willmer
2015-07-28 15:26:24aganders3setmessageid: <1438097184.53.0.634307237445.issue12006@psf.upfronthosting.co.za>
2015-07-28 15:26:24aganders3linkissue12006 messages
2015-07-28 15:26:23aganders3create