Your message dated Fri, 02 Nov 2018 22:02:11 +0000 with message-id <[email protected]> and subject line Bug#902755: fixed in python-imaplib2 2.55-1+deb9u2 has caused the Debian Bug report #902755, regarding Python 3 version broken, throws exception immediately after connecting to be marked as done.
This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the Bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what this message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact [email protected] immediately.) -- 902755: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=902755 Debian Bug Tracking System Contact [email protected] with problems
--- Begin Message ---Package: python3-imaplib2 Version: 2.57-2 Severity: grave Hi, Using this test program and Gmail as the IMAP server: M = imaplib2.IMAP4_SSL(host=IMAP_SERVER, debug=IMAP_DEBUG) M.login(IMAP_USERNAME, IMAP_PASSWORD) if (compress): M.enable_compression() M.SELECT(mailbox=IMAP_MAILBOX, readonly=True) M.FETCH('1:10', '(UID FLAGS)') M.LOGOUT() ...the Python3 version of this package immediately throws an exception after connecting and thus seems entirely broken: imaplib2.error: IMAP4 protocol error: program error: <class 'TypeError'> - cannot use a bytes pattern on a string-like object Even after fixing this, there is an additional issue that shows up only when enabling compression: imaplib2.abort: command: EXAMINE => socket error: <class 'TypeError'> - a bytes-like object is required, not 'str' Note that even stretch's 2.55 presents the latter issue, but not the former. The attached patch fixes both of those issues and makes the above simple test case work, although I haven't tried this any more complicated cases or with different IMAP servers. I went to upstream's GitHub in order to see if anyone else had reported this or to submit a PR, but to my surprise, it seems like upstream's repository has two different versions of imaplib2, one of them designated as "py3" and reporting itself as v3.05. That version does not exhibit any of these two issues above. Regards, Faidon--- x/usr/lib/python3/dist-packages/imaplib2.py 2017-03-05 03:23:58.000000000 +0200 +++ /usr/lib/python3/dist-packages/imaplib2.py 2018-06-30 15:36:18.645224464 +0300 @@ -302,8 +302,8 @@ # These must be encoded according to utf8 setting in _mode_xxx(): - _literal = br'.*{(?P<size>\d+)}$' - _untagged_status = br'\* (?P<data>\d+) (?P<type>[A-Z-]+)( (?P<data2>.*))?' + _literal = r'.*{(?P<size>\d+)}$' + _untagged_status = r'\* (?P<data>\d+) (?P<type>[A-Z-]+)( (?P<data2>.*))?' continuation_cre = re.compile(r'\+( (?P<data>.*))?') mapCRLF_cre = re.compile(r'\r\n|\r|\n') @@ -2215,13 +2215,13 @@ """send(data) Send 'data' to remote.""" + if bytes != str: + data = bytes(data, 'utf8') + if self.compressor is not None: data = self.compressor.compress(data) data += self.compressor.flush(zlib.Z_SYNC_FLUSH) - if bytes != str: - data = bytes(data, 'utf8') - if hasattr(self.sock, "sendall"): self.sock.sendall(data) else:
--- End Message ---
--- Begin Message ---Source: python-imaplib2 Source-Version: 2.55-1+deb9u2 We believe that the bug you reported is fixed in the latest version of python-imaplib2, which is due to be installed in the Debian FTP archive. A summary of the changes between this version and the previous one is attached. Thank you for reporting the bug, which will now be closed. If you have further comments please address them to [email protected], and the maintainer will reopen the bug report if appropriate. Debian distribution maintenance software pp. Ilias Tsitsimpis <[email protected]> (supplier of updated python-imaplib2 package) (This message was generated automatically at their request; if you believe that there is a problem with it please contact the archive administrators by mailing [email protected]) -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Format: 1.8 Date: Mon, 03 Sep 2018 11:44:48 +0300 Source: python-imaplib2 Binary: python-imaplib2 python3-imaplib2 Architecture: source Version: 2.55-1+deb9u2 Distribution: stretch Urgency: medium Maintainer: Ulises Vitulli <[email protected]> Changed-By: Ilias Tsitsimpis <[email protected]> Description: python-imaplib2 - Threaded Python IMAP4 client python3-imaplib2 - Threaded Python IMAP4 client (Python 3) Closes: 899102 902755 Changes: python-imaplib2 (2.55-1+deb9u2) stretch; urgency=medium . * Install the correct module for Python 3. Until now, python3-imaplib2 installed the Python 2 version of this module. Thanks to Faidon Liambotis for reporting this (Closes: 902755) * Apply patch to remove TIMEOUT_MAX variable. On some architectures, using threading.TIMEOUT_MAX for the timeout parameter can overflow causing Condition.wait() to return immediately. Thanks to Maximilian Stein for reporting this (Closes: #899102) Checksums-Sha1: c9bbd1829bfc50b3a288d1f707f7bef1b4905304 2044 python-imaplib2_2.55-1+deb9u2.dsc 386c531ac4c0e63295205edad027a41a7d9c8518 5972 python-imaplib2_2.55-1+deb9u2.debian.tar.xz 8b7b21a313a10337ee418323c09b74a7f3109fa5 7002 python-imaplib2_2.55-1+deb9u2_amd64.buildinfo Checksums-Sha256: d293163166be615025a09e90671498e7c61b832f6d241e3efe563c21ad0e06e7 2044 python-imaplib2_2.55-1+deb9u2.dsc aaac21effcfdc2661fce270035ca407751646099961fbf48731d7741bc68b36c 5972 python-imaplib2_2.55-1+deb9u2.debian.tar.xz 7750b37e1169c6c6a768eb6ffeb7af893cd6d8eda20da6abd2aec47d70d939c6 7002 python-imaplib2_2.55-1+deb9u2_amd64.buildinfo Files: 222cd934a36805e7d2b33cd60571ca22 2044 python optional python-imaplib2_2.55-1+deb9u2.dsc 02080e5d220989c0fb86b1efa2cc41e9 5972 python optional python-imaplib2_2.55-1+deb9u2.debian.tar.xz cd46aa3e1347a67846fabbf0854e4016 7002 python optional python-imaplib2_2.55-1+deb9u2_amd64.buildinfo -----BEGIN PGP SIGNATURE----- iQJIBAEBCgAyFiEEJ9c8pfW11+AaUTb116hngMxkQDwFAlvcL5oUHGlsaWFzdHNp QGRlYmlhbi5vcmcACgkQ16hngMxkQDw6vg//V5HnStvq6Mwqj+5Z+MH0TFi/Fmkr sk/EMH+xFI9uyMZSW0fn5WZjYE1SoEVRE/np1aPb2zda07ePNxOYTtFjaXEYe3Iu uTvLRfPeaYKZsgjJDSlunIq1mLRuTIw9b3SBBGNc9yMw7EQpxoOn0icWPQQLTNiB t22RQL8ykNAsR6WiO+TFmc9QJwhRIA0Gf87IxjbE1xmRHJLHjBKgQIUc4QFau0r7 38kVonXxhCa9K9s2tr3qA3TZe0j/ikplJv8yTTc3GjRuehYyBe9heMQoBWwtQh2f E0iDjnRUgEpqozLfvCi6nQiND/uJhBjyzjx4yOYsvlMZ/eEcv/7Vr2YYIbLJYb59 G5jtQzu4Oz7dqBxw5ZvS/94bRNl2MbeH/d2+YHQ9ou69sIDPHPwiCxSzRlm0sRUF GU5+JfGCnu+kAsoUearCgPM+BwDJdKn+23sUKVNPSnCooI44gB+cqB/xTLlFs1t6 ii6vNObI8xvic/wkJdSA74JNvzsvfZTh9vUuekbpUO1ZHPMJ3z5Depg1gRK8XkOx D9G0xkIrSOZdh0AMKsYjCAfNWp4JIhqvlNi2hXt9wDBz/LQh7sfJ0NjbfV3OlxYA hE9f0TugRdbyvAq/f9HLqn77ouGzztcCSDawYVgRDRL/s7i386BeVPs2GA7Gamum JFvx4N3gww4AXMs= =wZfL -----END PGP SIGNATURE-----
--- End Message ---

