Skip to content

Commit 87fef0c

Browse files
committed
change yy to < 1000
1 parent 693bce3 commit 87fef0c

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

Lib/email/_parseaddr.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,14 @@ def _parsedate_tz(data):
147147
# Check for a yy specified in two-digit format, then convert it to the
148148
# appropriate four-digit format, according to the POSIX standard. RFC 822
149149
# calls for a two-digit yy, but RFC 2822 (which obsoletes RFC 822)
150-
# mandates a 4-digit yy. For more information, see the documentation for
151-
# the time module.
152-
if yy < 999:
153-
# The year is between 1969 and 1999 (inclusive).
150+
# mandated a 4-digit yyyy, and RFC 5322 (which obsoletes RFC 2822)
151+
# continues this requirement. Two digit years between 69 and 99 inclusive,
152+
# and three digit years, are to be interpreted as 1900s dates, while those
153+
# between 0 and 68 are to be treated as 2000s dates.
154+
# (https://datatracker.ietf.org/doc/html/rfc5322#section-4.3)
155+
if yy < 1000:
154156
if yy > 68:
155157
yy += 1900
156-
# The year is between 2000 and 2068 (inclusive).
157158
else:
158159
yy += 2000
159160
tzoffset = None

0 commit comments

Comments
 (0)