簡體   English   中英

連接gmail的文件夾(** Labelname)時,Imaplib選擇失敗

[英]Imaplib Select Fails while connecting folder(**Labelname) of gmail

我使用imaplib模塊連接到Gmail Imap,我收到了下面提到的錯誤。 我正在使用select命令進行連接

Labelname is  **LabelName 

我收到此錯誤:

    resp, data = self._imap.select("**LabelName")
  File "/usr/lib/python2.6/imaplib.py", line 642, in select
    typ, dat = self._simple_command(name, mailbox)
  File "/usr/lib/python2.6/imaplib.py", line 1060, in _simple_command
    return self._command_complete(name, self._command(name, *args))
  File "/usr/lib/python2.6/imaplib.py", line 895, in _command_complete
    raise self.error('%s command error: %s %s' % (name, typ, data))
imaplib.error: SELECT command error: BAD ['Could not parse command']

而如果Labelname是

** LabelName 

它成功連接。

誰能告訴我這里發生了什么?

找出問題,使用imaplib進行連接時我們需要像這樣連接:

imapobj.select('"'+ '**Foldername' + '"')

這樣結果就像這樣選擇

"**Foldername"

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM