Message125609
Attached patch, issue10827c.diff, implements the following logic in gettmarg:
/* If year is specified with less that 4 digits, its interpretation
* depends on the accept2dyear value.
*
* If accept2dyear is true (default), a backward compatibility behavior is
* invoked as follows:
*
* - for 2-digit year, century is guessed according to POSIX rules for
* %y strptime format: 21st century for y < 69, 20th century
* otherwise. A deprecation warning is issued when century
* information is guessed in this way.
*
* - for 3-digit or negative year, a ValueError exception is raised.
*
* If accept2dyear is false (set by the program or as a result of a
* non-empty value assigned to PYTHONY2K environment variable) all year
* values are interpreted as given.
*/
It is easy to restore year >= 1900 limit for strftime, but I would rather add tests that time.strftime either produces correct values or raises ValueError and see if buildbots discover any platform bugs. |
|
Date |
User |
Action |
Args |
2011-01-07 00:57:17 | belopolsky | set | recipients:
+ belopolsky, georg.brandl, vstinner, Trundle, SilentGhost |
2011-01-07 00:57:17 | belopolsky | set | messageid: <1294361837.11.0.862709019578.issue10827@psf.upfronthosting.co.za> |
2011-01-07 00:57:15 | belopolsky | link | issue10827 messages |
2011-01-07 00:57:15 | belopolsky | create | |
|