[New-bugs-announce] [issue10939] imaplib: Internaldate2tuple fails to parse month and does not work with negative TZ offset due to bytes/str issues

Joe Peterson 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)
files: imaplib_Internaldate2tuple_bytes_fixes_python32.patch
keywords: patch
messages: 126499
nosy: lavajoe
priority: normal
severity: normal
status: open
title: imaplib: Internaldate2tuple fails to parse month and does not work with negative TZ offset due to bytes/str issues
type: behavior
versions: Python 3.2
Added file: http://bugs.python.org/file20444/imaplib_Internaldate2tuple_bytes_fixes_python32.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10939>
_______________________________________


More information about the New-bugs-announce mailing list