Message324586
Let's consider there is an email box with password which contains Cyrillic symbols. When loging in
imaplib.IMAP4_SSL(host, port).login(login, password)
password field is passed as "кириллица" (type is str, not unicode).
Then, I get this traceback:
File "/usr/lib64/python2.7/imaplib.py", line 518, in login
typ, dat = self._simple_command('LOGIN', user, self._quote(password))
File "/usr/lib64/python2.7/imaplib.py", line 1083, in _simple_command
return self._command_complete(name, self._command(name, *args))
File "/usr/lib64/python2.7/imaplib.py", line 870, in _command
self.send('%s%s' % (data, CRLF))
File "/usr/lib64/python2.7/imaplib.py", line 1191, in send
sent = self.sslobj.write(data)
File "/usr/lib64/python2.7/ssl.py", line 669, in write
return self._sslobj.write(data)
This is because self._sslobj.write method requires unicode string.
In other case, if password field is passed as u"кириллица" (type unicode, not str), I get another traceback:
File "/usr/lib64/python2.7/imaplib.py", line 518, in login
typ, dat = self._simple_command('LOGIN', user, self._quote(password))
File "/usr/lib64/python2.7/imaplib.py", line 1083, in _simple_command
return self._command_complete(name, self._command(name, *args))
File "/usr/lib64/python2.7/imaplib.py", line 852, in _command
data = '%s %s' % (data, self._checkquote(arg))
It's because '%s' % u"some unicode string" doesn't work.
I guess the problem was described in details.
The problem is that two different libraries are using different string types but they must be agreed. |
|
Date |
User |
Action |
Args |
2018-09-04 14:11:45 | Nikita Velykanov | set | recipients:
+ Nikita Velykanov, vstinner, ezio.melotti |
2018-09-04 14:11:45 | Nikita Velykanov | set | messageid: <1536070305.76.0.56676864532.issue34577@psf.upfronthosting.co.za> |
2018-09-04 14:11:45 | Nikita Velykanov | link | issue34577 messages |
2018-09-04 14:11:45 | Nikita Velykanov | create | |
|