[New-bugs-announce] [issue10939] imaplib: Internaldate2tuple fails to parse month and does not work with negative TZ offset due to bytes/str issues
report at bugs.python.org
Tue Jan 18 23:31:40 CET 2011
New submission from Joe Peterson <joe at skyrush.com>:
There are two issues with conversion to Python 3:
1. It raise "KeyError". This is because the Mon2num dictionary keys are strings (str), not bytes objects (note that many other strings in imaplib have been updated, but not Mon2num).
2. The sign character of the TZ offset (e.g. -0700) is compared to the string (str) '-', not bytes array b'-', so the compare is never true, causing a large error when the TZ offset is negative.
Patch attached that also adds a unit test.
components: Library (Lib)
title: imaplib: Internaldate2tuple fails to parse month and does not work with negative TZ offset due to bytes/str issues
versions: Python 3.2
Added file: http://bugs.python.org/file20444/imaplib_Internaldate2tuple_bytes_fixes_python32.patch
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce