Geert Jansen added the comment:

> newPySSLSocket() expects a char* string and use PyUnicode_Decode() to decode 
> bytes.

Yup, and this value is available as SSLSocket._sslobj.server_hostname. But 
SSLSocket.server_hostname is not this, it is what was passed to the constructor 
which can be a bytes instance.

For total cleanness maybe the constructor should raise a TypeError if 
server_hostname is passes as a bytes.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue22564>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to