[issue33741] UnicodeEncodeError onsmtplib.login(MAIL_USER, MAIL_PASSWORD)

2018-06-02 Thread Lars Pötter

New submission from Lars Pötter :

if the password contains non ascii characters then the login fails:
>>> smtObj.login(MAIL_USER, MAIL_PASSWORD) 
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.5/smtplib.py", line 720, in login
initial_response_ok=initial_response_ok)
  File "/usr/lib/python3.5/smtplib.py", line 637, in auth
authobject(challenge).encode('ascii'), eol='')
  File "/usr/lib/python3.5/smtplib.py", line 650, in auth_cram_md5
self.password.encode('ascii'), challenge, 'md5').hexdigest()
UnicodeEncodeError: 'ascii' codec can't encode character '' in 
position : ordinal not in range(128)

--
components: Library (Lib)
messages: 318517
nosy: JustAnother1
priority: normal
severity: normal
status: open
title: UnicodeEncodeError onsmtplib.login(MAIL_USER, MAIL_PASSWORD)
type: crash
versions: Python 3.5

___
Python tracker 
<https://bugs.python.org/issue33741>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33741] UnicodeEncodeError onsmtplib.login(MAIL_USER, MAIL_PASSWORD)

2018-06-10 Thread Lars Pötter

Lars Pötter  added the comment:

I wanted to login to an existing account so the password works OK in 
Thunderbird.

Here in Germany it is recommended for safe passwords to use the German 
umlauts(ßÄÖÜäöü). So code page 437 vs 850 or UTF-8 ?

If I could pass in the bytes then I could figure out the correct encoding 
myself.(Try and error) I suppose that in other regions people want to use other 
encodings. And as long as the encoding is the same when setting the password 
and transmitting the password then everything is fine, right?

--

___
Python tracker 
<https://bugs.python.org/issue33741>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com