izderadicka / imap_detach

Command line client for downloading email attachments
13 stars 1 forks source link

Error in imapclient under python 3.9: TypeError: open() takes 3 positional arguments but 4 were given #13

Open emclain opened 3 years ago

emclain commented 3 years ago

imap_detach requires imapclient-1.0.0, but it seems that is no longer compliant with newer python.

/usr/local/bin/detach.py --host example.com --user ex@example.com --test "! seen" ERROR:imap_client:Runtime Error Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/imap_detach/imap_client.py", line 164, in main c=IMAP_client_factory(host,port,use_ssl=ssl) File "/usr/local/lib/python3.9/site-packages/imap_detach/utils.py", line 81, in IMAP_client_factory return imapclient.IMAPClient(host,port,ssl=use_ssl, ssl_context=ssl_context, timeout=60) File "/usr/local/lib/python3.9/site-packages/imapclient/imapclient.py", line 152, in init self._imap = self._create_IMAP4() File "/usr/local/lib/python3.9/site-packages/imapclient/imapclient.py", line 163, in _create_IMAP4 return tls.IMAP4_TLS(self.host, self.port, self.ssl_context, File "/usr/local/lib/python3.9/site-packages/imapclient/tls.py", line 153, in init imaplib.IMAP4.init(self, host, port) File "/usr/local/Cellar/python@3.9/3.9.1_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/imaplib.py", line 206, in init self.open(host, port, timeout) TypeError: open() takes 3 positional arguments but 4 were given

izderadicka commented 3 years ago

Thanks - yes imapclient 1.0.0 is ancient - you can try to update to newer one and see how it goes - if successful please submit PR.