Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

connection to IMAP-SSL host fails on armhf #3

Open
st31ny opened this issue May 27, 2018 · 4 comments
Open

connection to IMAP-SSL host fails on armhf #3

st31ny opened this issue May 27, 2018 · 4 comments

Comments

@st31ny
Copy link

st31ny commented May 27, 2018

I already submitted this bug to the Debian bugtracker (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=899102).

Apparently, connection to an IMAP host fails on at least armhf platforms (such as Raspberry Pi):

>>> import imaplib2
>>> c=imaplib2.IMAP4('imap.strato.de')
  26:45.17 imap.strato.de reader last 20 log messages:
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3/dist-packages/imaplib2.py", line 400, in __init__
    self.welcome = self._request_push(name='welcome', tag='continuation').get_response('IMAP4 protocol error: %s')[1]
TypeError: 'NoneType' object is not subscriptable

The same sequence of commands works like a charm on amd64. I tested both, 2.55 and 2.57.

Thank you for your help!

@tari01
Copy link

tari01 commented May 27, 2018

I think you have the same problem as I with i386 (see the other open issue). As far as I can tell, imaplib2 currently only works on amd64. Also, the project seems to be abandoned - I have had no response since I reported it quite some time ago...

@st31ny
Copy link
Author

st31ny commented May 28, 2018

True, this seems to be related… What a pity — is there a chance to find the bug ourselves in reasonable time?

@graingert
Copy link
Member

Project not abandoned happy to accept PR with testcase

@st31ny
Copy link
Author

st31ny commented May 28, 2018

Great to hear that!

Well, I tried to dig a bit into the code. When I enable debugging, I get this:

>>> c=imaplib2.IMAP4('imap.strato.de')
starting
starting using poll
_request_push(continuation, welcome, {}) = LBHN0
welcome:LBHN0.ready.wait
_close_threads
finished
call shutdown
poll => [(3, 17)]
  42:38.04 imap.strato.de reader last 20 log messages:
socket error:  - [Errno 9] Bad file descriptor
finished
starting
terminating: 'Terminated'
welcome:LBHN0.ready.set
state_change_free.set
finished
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3/dist-packages/imaplib2.py", line 400, in __init__
    self.welcome = self._request_push(name='welcome', tag='continuation').get_response('IMAP4 protocol error: %s')[1]
TypeError: 'NoneType' object is not subscriptable

So, there seems to be a bad file descriptor involved. I hope this helps.

EDIT:
I am actually seeing two different exception. Sometimes the poll() call signals an error condition of POLLNVAL (https://github.com/imaplib2/imaplib2/blob/master/imaplib2/imaplib2.py3#L1856), sometimes, reading the socket fails (https://github.com/imaplib2/imaplib2/blob/master/imaplib2/imaplib2.py3#L527)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants