2011-09-11 3 views
1

이 스크립트 :AppEngine 용 Python 스크립트에서이 imaplib 오류의 원인은 무엇입니까?

import imaplib 

    user = "[email protected]" 
    pwd = "***" 

    m = imaplib.IMAP4_SSL("imap.gmail.com") 
    m.login(user,pwd) 
    m.select("Inbox") # here you a can choose a mail box like INBOX instead 
    m.search("NEW") 

나를 위해이 오류를 만든다 :

Traceback (most recent call last): 
    File "c:\Program Files\Google\google_appengine\google\appengine\ext\webapp\_webapp25.py", line 701, in __call__ 
    handler.get(*groups) 
    File "c:\Users\Dave\git_stuff\Touch Base\Touch Base\main.py", line 30, in get 
    m = imaplib.IMAP4_SSL("imap.gmail.com") 
    File "c:\Python26\lib\imaplib.py", line 1138, in __init__ 
    IMAP4.__init__(self, host, port) 
    File "c:\Python26\lib\imaplib.py", line 163, in __init__ 
    self.open(host, port) 
    File "c:\Python26\lib\imaplib.py", line 1149, in open 
    self.sock = socket.create_connection((host, port)) 
AttributeError: 'module' object has no attribute 'create_connection' 

이유는 무엇입니까?

+0

참조 된 행을 볼 수 있습니까? 1149 & 163? – Coffee

+1

여기서 파이썬 소스 코드를 복사하지는 않겠지 만, 차이가 나는 경우 완전한 스택 추적을 작성했습니다. – Trindaz

답변

0

주에서 또한 설명을 참조하십시오 당신은 Gmail Inbox Feed를 사용하여 Gmail받은 편지함을 읽을 수 있습니다 .