From f4bdb2ee180fa79c83d52db3daf47cf1b5137b11 Mon Sep 17 00:00:00 2001 From: Menno Smits Date: Tue, 30 Jun 2015 11:04:14 +1200 Subject: [PATCH] Renamed _normalise to _munge to avoid overlap with the other meaning of "normalise" here --- imapclient/datetime_util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imapclient/datetime_util.py b/imapclient/datetime_util.py index bb807b4..231979e 100644 --- a/imapclient/datetime_util.py +++ b/imapclient/datetime_util.py @@ -20,7 +20,7 @@ def parse_to_datetime(timestamp, normalise=True): If normalise is False, then the returned datetime will be unadjusted but will contain timezone information as per the input. """ - time_tuple = parsedate_tz(_normalise(timestamp)) + time_tuple = parsedate_tz(_munge(timestamp)) if time_tuple == None: raise ValueError("couldn't parse datetime %r" % timestamp) @@ -43,7 +43,7 @@ def datetime_to_native(dt): # issue #154). For example: 'Sat, 8 May 2010 16.03.09 +0200' _rfc822_dotted_time = re.compile("\w+, ?\d{1,2} \w+ \d\d(\d\d)? \d\d?\.\d\d?\.\d\d?.*") -def _normalise(s): +def _munge(s): s = s.decode('latin-1') # parsedate_tz only works with strings if _rfc822_dotted_time.match(s): return s.replace(".", ":") -- 2.43.0