Closed sunweaver closed 3 years ago
No, no, no! The imaplib2 is half-dead, abandoned and buggy as hell. We need to provide a copy that works for us. The one currently bundled has been tweaked by me.
Sad, but unavoidable right now.
No, no, no! The imaplib2 is half-dead, abandoned and buggy as hell. We need to provide a copy that works for us. The one currently bundled has been tweaked by me.
Sad, but unavoidable right now.
Hmmm... when comparing your version and the imaplib2 version in Debian, there is only one improvement the Debian version has which yours has not:
$ diff -u /usr/lib/python3/dist-packages/imaplib2.py ayatanawebmail/imaplib2.py
--- /usr/lib/python3/dist-packages/imaplib2.py 2021-01-18 11:58:10.000000000 +0100
+++ ayatanawebmail/imaplib2.py 2021-01-25 17:16:15.392959708 +0100
@@ -492,17 +492,7 @@
ssl_version = TLS_MAP[self.tls_level][self.ssl_version]
- if getattr(ssl, 'HAS_SNI', False):
- ctx = ssl.SSLContext(ssl_version)
- ctx.verify_mode = cert_reqs
- if self.ca_certs is not None:
- ctx.load_verify_locations(self.ca_certs)
- if self.certfile or self.keyfile:
- ctx.load_cert_chain(self.certfile, self.keyfile)
- self.sock = ctx.wrap_socket(self.sock, server_hostname=self.host)
- else:
- self.sock = ssl.wrap_socket(self.sock, self.keyfile, self.certfile, ca_certs=self.ca_certs, cert_reqs=cert_reqs, ssl_version=ssl_version)
-
+ self.sock = ssl.wrap_socket(self.sock, self.keyfile, self.certfile, ca_certs=self.ca_certs, cert_reqs=cert_reqs, ssl_version=ssl_version)
ssl_exc = ssl.SSLError
self.read_fd = self.sock.fileno()
except ImportError:
@@ -1379,7 +1369,7 @@
self.ouq.put(rqb)
return rqb
- # Must setup continuation expectancy *before* ouq.put
+ # Must setup continuation expectancy *before* ouq.put
crqb = self._request_push(name=name, tag='continuation')
self.ouq.put(rqb)
@@ -1395,7 +1385,7 @@
if not ok:
break
- if data == 'go ahead': # Apparently not uncommon broken IMAP4 server response to AUTHENTICATE command
+ if data == 'go ahead': # Apparently not uncommon broken IMAP4 server response to AUTHENTICATE command
data = ''
# Send literal
@@ -2563,7 +2553,7 @@
run('id', ())
run('id', ("(name imaplib2)",))
run('id', ("version", __version__, "os", os.uname()[0]))
-
+
for cmd,args in test_seq2:
if (cmd,args) != ('uid', ('SEARCH', 'SUBJECT', 'IMAP4 test')):
Maybe reconsider? This is Debian package python3-imaplib2 2.57-5.2 (from Debian testing).
sunweaver feels tempted to reopen this bug...
It might work for Debian, but what about other distributions that get their imaplib2 from god-knows-where? If it works for you with the stock module, can you leave our version in the source tree, and simply exclude it from the Debian package?
The application should rather require the imaplib2 Python module be available in the Linux distribution rather than embedding it as a bundled copy of code.