jazzband / imaplib2

Fork of Piers Lauder's imaplib2 library for Python.
https://imaplib2.readthedocs.io/
MIT License
33 stars 29 forks source link

Unexpected error while sitting idle() - command: IDLE => socket error: <class 'OSError'> - Too many read 0 #8

Open 3rock618 opened 5 years ago

3rock618 commented 5 years ago

Could this be related to too many IDLE calls in a session? My script waits for an email, reads/parses, and then goes back IDLE. This is the second time this error has happened. It happens somewhere around 12-15 hours since first connecting.

Traceback (most recent call last):
  File "paper_trader.py", line 303, in <module>
    try: run()
  File "paper_trader.py", line 300, in run
    gm_set_idle()
  File "paper_trader.py", line 141, in gm_set_idle
    gm.idle()
  File "/home/ubuntu/.local/lib/python3.7/site-packages/imaplib2/imaplib2.py", line 839, in idle
    return self._simple_command(name, **kw)
  File "/home/ubuntu/.local/lib/python3.7/site-packages/imaplib2/imaplib2.py", line 1643, in _simple_command
    return self._command_complete(self._command(name, *args), kw)
  File "/home/ubuntu/.local/lib/python3.7/site-packages/imaplib2/imaplib2.py", line 1396, in _command_complete
    typ, dat = rqb.get_response('command: %s => %%s' % rqb.name)
  File "/home/ubuntu/.local/lib/python3.7/site-packages/imaplib2/imaplib2.py", line 189, in get_response
    raise typ(exc_fmt % str(val))
imaplib2.imaplib2.IMAP4.abort: command: IDLE => socket error: <class 'OSError'> - Too many read 0
> /home/ubuntu/.local/lib/python3.7/site-packages/imaplib2/imaplib2.py(189)get_response()
-> raise typ(exc_fmt % str(val))