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 belopolsky
Recipients SilentGhost, Trundle, belopolsky, georg.brandl, vstinner
Date 2011-01-07.00:57:15
SpamBayes Score 4.4395e-09
Marked as misclassified No
Message-id <1294361837.11.0.862709019578.issue10827@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2011-01-07 00:57:17belopolskysetrecipients: + belopolsky, georg.brandl, vstinner, Trundle, SilentGhost
2011-01-07 00:57:17belopolskysetmessageid: <1294361837.11.0.862709019578.issue10827@psf.upfronthosting.co.za>
2011-01-07 00:57:15belopolskylinkissue10827 messages
2011-01-07 00:57:15belopolskycreate