小编ror*_*osy的帖子

Python IMAP4选择邮箱名称包含空格字符,错误

我正在使用Python imaplib.IMAP4连接到Google电子邮件.除非我使用IMAP4.select()包含空格字符的邮箱名称的方法,否则每件事都可以.假设我的邮箱名称是"Gama Sutra".

当我执行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']
Run Code Online (Sandbox Code Playgroud)

我该如何解决?

python imap imaplib

1
推荐指数
1
解决办法
1772
查看次数

标签 统计

imap ×1

imaplib ×1

python ×1