From: Menno Smits Date: Mon, 29 Jun 2015 23:04:14 +0000 (+1200) Subject: Renamed _normalise to _munge to avoid overlap with the other meaning of "normalise... X-Git-Tag: 0.13~1^2~8 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=f4bdb2ee180fa79c83d52db3daf47cf1b5137b11;p=imapclient.git Renamed _normalise to _munge to avoid overlap with the other meaning of "normalise" here --- 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(".", ":")