Message233253
Thank you Jim for your patch. That all right and the patch fixes the issue. But
the code looks a little tricky, and it would be more robust to use other
signal value for julian (e.g. None).
However I'm not sure that strptime should accept weekdays before the start of
year. In C the strptime function doesn't return valid date for such input.
$ ./strptimetest "0 2015 1" "%W %Y %w"
2015-00--2 00:00:00
$ ./strptimetest "0 2015 2" "%W %Y %w"
2015-00--1 00:00:00
$ ./strptimetest "0 2015 3" "%W %Y %w"
2015-00-00 00:00:00
$ ./strptimetest "0 2015 4" "%W %Y %w"
2015-01-01 00:00:00
$ ./strptimetest "0 2015 5" "%W %Y %w"
2015-01-02 00:00:00
$ ./strptimetest "0 2015 6" "%W %Y %w"
2015-01-03 00:00:00
$ ./strptimetest "0 2015 7" "%W %Y %w"
2015-01-00 00:00:00
May be Python strptime should raise an exception for weekdays before the start
of year as well as it raise an exception for weekdays out of range 0-6.
I'm not sure that any patch should be applied to maintained releases. |
|
Date |
User |
Action |
Args |
2014-12-31 16:51:29 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, lemburg, belopolsky, jamercee, Saimadhav.Heblikar |
2014-12-31 16:51:29 | serhiy.storchaka | link | issue23136 messages |
2014-12-31 16:51:28 | serhiy.storchaka | create | |
|