Author gundlach
Recipients chris.stawarz, facundobatista, giampaolo.rodola, gundlach, jafo, janssen, jcea, orsenthil, pitrou
Date 2012-06-28.15:56:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1340898963.64.0.589045870967.issue1251@psf.upfronthosting.co.za>
In-reply-to
Content
I recently started getting what appears to be this bug in 2.6.6 and 2.7.3 when connecting to Google.

My script does this:

  while True:
    get an IMAP connection to Google, if our old one timed out
    fetch unread messages.  if any:
      make an SMTP connection to Google and send some emails 
      mark the unread messages as read
    sleep 10 seconds

It used to run fine on 2.6.  I'm assuming something changed at Google, because it started hanging, whether in 2.6 or 2.7.  Here's the stack trace when I eventually press Ctrl-C:

 File "./main.py", line 21, in loop
    the_emails = list(emails.messages('(UNSEEN)'))
  File "./emails.py", line 129, in messages
    for chunk in chunks_of_length(32, messages):
  File "./chunks.py", line 9, in chunks_of_length
    for item in iterable:
  File "./emails.py", line 90, in email_messages
    m = open_mailbox(label, readonly=True)
  File "./emails.py", line 30, in open_mailbox
    m = imaplib.IMAP4_SSL('imap.gmail.com', 993)
  File "/usr/lib64/python2.6/imaplib.py", line 1138, in __init__
    IMAP4.__init__(self, host, port)
  File "/usr/lib64/python2.6/imaplib.py", line 163, in __init__
    self.open(host, port)
  File "/usr/lib64/python2.6/imaplib.py", line 1150, in open
    self.sslobj = ssl.wrap_socket(self.sock, self.keyfile, self.certfile)
  File "/usr/lib64/python2.6/ssl.py", line 338, in wrap_socket
    suppress_ragged_eofs=suppress_ragged_eofs)
  File "/usr/lib64/python2.6/ssl.py", line 120, in __init__
    self.do_handshake()
  File "/usr/lib64/python2.6/ssl.py", line 279, in do_handshake
    self._sslobj.do_handshake()
KeyboardInterrupt

FWIW, for the last couple of days my script is *not* hanging, so perhaps Google changed something on their end, avoiding the Python bug.

Should this Issue be reopened or should I file a new Issue?
History
Date User Action Args
2012-06-28 15:56:03gundlachsetrecipients: + gundlach, facundobatista, jafo, jcea, janssen, orsenthil, pitrou, giampaolo.rodola, chris.stawarz
2012-06-28 15:56:03gundlachsetmessageid: <1340898963.64.0.589045870967.issue1251@psf.upfronthosting.co.za>
2012-06-28 15:56:03gundlachlinkissue1251 messages
2012-06-28 15:56:02gundlachcreate