Message227409
I don't have the repo handy to make a patch against 3.5, but would an addition like this do?
in Lib/_strptime.py:
+ elif iso_week != -1 and iso_year == -1:
+ raise ValueError("'%Y' directive is ambiguous in combination with '%V'. Use '%G' instead.")
+ elif julian == -1 and iso_week != -1 and iso_weekday != -1:
+ year, julian = _calc_julian_from_V(iso_year, iso_week, iso_weekday)
In Lib/test/test_strptime.py:
def test_ValueError(self):
+ # Make sure ValueError is raised when match fails or format is bad
+ self.assertRaises(ValueError, _strptime._strptime, data_string="1905 52",
+ format="%Y %V") |
|
Date |
User |
Action |
Args |
2014-09-24 07:17:46 | Erik Cederstrand | set | recipients:
+ Erik Cederstrand, tim.peters, belopolsky, r.david.murray, BreamoreBoy, Erik.Cederstrand, AaronR, aganders3, Alex.Willmer |
2014-09-24 07:17:46 | Erik Cederstrand | set | messageid: <1411543066.71.0.67432007195.issue12006@psf.upfronthosting.co.za> |
2014-09-24 07:17:46 | Erik Cederstrand | link | issue12006 messages |
2014-09-24 07:17:46 | Erik Cederstrand | create | |
|