Skip to content

Commit

Permalink
Merge pull request #610 from wshanks/wshanks-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
sfdye authored Jan 12, 2023
2 parents 80523f3 + c91d70b commit 02f7a81
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/future/backports/http/cookiejar.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,14 @@ def _str2time(day, mon, yr, hr, min, sec, tz):
(?::(\d\d))? # optional seconds
)? # optional clock
\s*
([-+]?\d{2,4}|(?![APap][Mm]\b)[A-Za-z]+)? # timezone
(?:
([-+]?\d{2,4}|(?![APap][Mm]\b)[A-Za-z]+) # timezone
\s*
)?
(?:
\(\w+\) # ASCII representation of timezone in parens.
\s*
(?:\(\w+\))? # ASCII representation of timezone in parens.
\s*$""", re.X | re.ASCII)
)?$""", re.X | re.ASCII)
def http2time(text):
"""Returns time in seconds since epoch of time represented by a string.
Expand Down Expand Up @@ -298,9 +302,11 @@ def http2time(text):
(?::?(\d\d(?:\.\d*)?))? # optional seconds (and fractional)
)? # optional clock
\s*
([-+]?\d\d?:?(:?\d\d)?
|Z|z)? # timezone (Z is "zero meridian", i.e. GMT)
\s*$""", re.X | re. ASCII)
(?:
([-+]?\d\d?:?(:?\d\d)?
|Z|z) # timezone (Z is "zero meridian", i.e. GMT)
\s*
)?$""", re.X | re. ASCII)
def iso2time(text):
"""
As for http2time, but parses the ISO 8601 formats:
Expand Down

0 comments on commit 02f7a81

Please sign in to comment.