Cannot connect to IMAP server in Python 3.2
Steven D'Aprano
steve+comp.lang.python at pearwood.info
Thu Apr 5 00:49:57 EDT 2012
I can connect to an IMAP server using Python 2.6:
steve at runes:~$ python2.6
Python 2.6.6 (r266:84292, Dec 27 2010, 00:02:40)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import imaplib
>>> server = imaplib.IMAP4_SSL('xxxxx')
>>> print server
<imaplib.IMAP4_SSL instance at 0xb7183c4c>
But when I try with Python 3.2, it just sits there until it times out:
steve at runes:~$ python3.2
Python 3.2.2 (default, Feb 29 2012, 18:11:33)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import imaplib
>>> server = imaplib.IMAP4('xxxxx', imaplib.IMAP4_SSL_PORT)
Traceback (most recent call last):
[...]
socket.timeout: timed out
What am I doing wrong?
--
Steven
More information about the Python-list
mailing list