Fix bug #1520914. Starting in 2.4, time.strftime() began to check the bounds

of values in the time tuple passed in.  Unfortunately people came to rely on
undocumented behaviour of setting unneeded values to 0, regardless of if it was
within the valid range.  Now those values force the value internally to the
minimum value when 0 is passed in.
This commit is contained in:
Brett Cannon 2006-07-18 04:41:36 +00:00
parent 4b7e35b530
commit caebe22038
4 changed files with 56 additions and 16 deletions

View file

@ -226,6 +226,8 @@ if any field in \var{t} is outside of the allowed range.
\versionchanged[Allowed \var{t} to be omitted]{2.1}
\versionchanged[\exception{ValueError} raised if a field in \var{t} is
out of range]{2.4}
\versionchanged[0 is now a legal argument for any position in the time tuple;
if it is normally illegal the value is forced to a correct one.]{2.5}
The following directives can be embedded in the \var{format} string.