【发布时间】:2016-02-14 13:32:15
【问题描述】:
我正在使用 Python imaplib.IMAP4 连接到 Google 电子邮件。除了我使用包含空格字符的邮箱名称使用IMAP4.select() 方法外,一切都很好。假设我的邮箱名称是“伽玛经”。
当我执行imap.select('[Gmail]/Gama Sutra') 时,它给了我这个错误:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/imaplib.py", line 682, in select
typ, dat = self._simple_command(name, mailbox)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/imaplib.py", line 1133, in _simple_command
return self._command_complete(name, self._command(name, *args))
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/imaplib.py", line 964, in _command_complete
raise self.error('%s command error: %s %s' % (name, typ, data))
imaplib.error: SELECT command error: BAD [b'Could not parse command']
我该如何解决?
【问题讨论】: