pyopenssl raises SysCallError(-1, "Unexpected EOF")
arnisoph opened this issue · comments
pyopenssl raises "from time to time" SysCallError(-1, "Unexpected EOF"):
Traceback (most recent call last):
File "/usr/local/lib/python3.5/site-packages/backports/ssl/core.py", line 201, in _safe_ssl_call
return getattr(sock, call)(*args, **kwargs)
File "/usr/local/lib/python3.5/site-packages/OpenSSL/SSL.py", line 1320, in recv
self._raise_ssl_error(self._ssl, result)
File "/usr/local/lib/python3.5/site-packages/OpenSSL/SSL.py", line 1180, in _raise_ssl_error
raise SysCallError(-1, "Unexpected EOF")
OpenSSL.SSL.SysCallError: (-1, 'Unexpected EOF')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/tabellarius/tabellarius.py", line 180, in <module>
exit(main())
File "/tabellarius/tabellarius.py", line 142, in main
mail_uids = imap_pool[acc].search_mails(pre_inbox, pre_inbox_search)
File "/tabellarius/imap.py", line 61, in search_mails
result = self.select_mailbox(mailbox)
File "/tabellarius/imap.py", line 53, in select_mailbox
return self.conn.select_folder(mailbox)
File "/usr/local/lib/python3.5/site-packages/imapclient/imapclient.py", line 474, in select_folder
self._command_and_check('select', self._normalise_folder(folder), readonly)
File "/usr/local/lib/python3.5/site-packages/imapclient/imapclient.py", line 1173, in _command_and_check
typ, data = meth(*args)
File "/usr/local/lib/python3.5/imaplib.py", line 729, in select
typ, dat = self._simple_command(name, mailbox)
File "/usr/local/lib/python3.5/imaplib.py", line 1180, in _simple_command
return self._command_complete(name, self._command(name, *args))
File "/usr/local/lib/python3.5/imaplib.py", line 1003, in _command_complete
typ, data = self._get_tagged_response(tag)
File "/usr/local/lib/python3.5/imaplib.py", line 1123, in _get_tagged_response
self._get_response()
File "/usr/local/lib/python3.5/imaplib.py", line 1031, in _get_response
resp = self._get_line()
File "/usr/local/lib/python3.5/imaplib.py", line 1133, in _get_line
line = self.readline()
File "/usr/local/lib/python3.5/site-packages/imapclient/tls.py", line 166, in readline
return self.file.readline()
File "/usr/local/lib/python3.5/site-packages/backports/ssl/core.py", line 540, in readline
data = _safe_ssl_call(False, self._sock, 'recv', self._rbufsize)
File "/usr/local/lib/python3.5/site-packages/backports/ssl/core.py", line 216, in _safe_ssl_call
raise SSLSysCallError(*e.args)
backports.ssl.core.SSLSysCallError: [Errno -1] Unexpected EOF
This appears on Python 3.2, 3.5 and others maybe too with the latest available version of backports.ssl and pyopenssl on pypi.
hmm, I think it's better to move this bug report to the high level module that I use (https://bitbucket.org/mjs0/imapclient/issues/200/pyopenssl-raises-syscallerror-1-unexpected).