Cannot connect to IMAP server in Python 3.2

Steven D'Aprano steve+comp.lang.python at pearwood.info
Thu Apr 5 08:16:09 EDT 2012


On Thu, 05 Apr 2012 00:21:31 -0700, Steve Howell wrote:

> I'm not suggesting that you debug the standard library because I think
> the library itself is broken. I'm suggesting that using the source code
> that's freely available to you can help you have some insight on what's
> going wrong.
> 
> Do you have a working theory on what you're doing wrong? 

Actually, between you and me and the thousands of others reading this 
thread, I actually do suspect it is a bug in the std library 
implementation. But the suspicion is only that, and my first *assumption* 
is that it is more likely I am doing something wrong. Hence my question.


> You've already
> ruled out the port.  Why are you changing the invocation between
> versions of Python?

Because imaplib.IMAP4_SSL apparently no longer exists in Python 3.

>>> server = imaplib.IMAP4_SSL('xxxxx')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'IMAP4_SSL'



> imaplib.IMAP4_SSL('xxxxx') # 2.6
> imaplib.IMAP4('xxxxx', imaplib.IMAP4_SSL_PORT) # 3.2
> 
> I'm sure the standard library works fine, and you're just doing
> something silly, like mistyping the host name or forgetting to start the
> server.  Maybe you're running 3.2 in a slightly different OS
> environment?

If you look carefully at my copy-and-pasted sessions, you will see that 
both of them are on the same host, "runes". While I suppose that 
technically I could have two hosts both called runes, in fact I only have 
one :)

And no, I have not mistyped the host name.



-- 
Steven



More information about the Python-list mailing list