Message25216
rfc822.parsedate and email.Utils.parsedate don't take Y2K into
account when parsing two-digit years, even though they're allowed by
RFC822. Even though that spec has since been superseded, there
are still systems generating dates in the old format, and RFC2616,
which bases its dates on RFC822, still allows two-digit years.
For example,
>>> email.Utils.parsedate("Sun, 6 Nov 94 08:49:37 GMT")
(94, 11, 6, 8, 49, 37, 0, 0, 0)
Here's a trivial patch to behave as outlined in the time module (I don't
test for time.accept2dyear because the input is outside the system's
control, and RFC-specified); it's against 2.3, but should be easy to
integrate into later versions.
125a126,130
> if yy < 100:
> if yy > 68:
> yy = yy + 1900
> else:
> yy = yy + 2000 |
|
Date |
User |
Action |
Args |
2007-08-23 14:31:32 | admin | link | issue1194222 messages |
2007-08-23 14:31:32 | admin | create | |
|