[issue8477] _ssl: support surrogates in filenames, and bytes/bytearray filenames

Antoine Pitrou report at bugs.python.org
Wed Apr 21 01:45:39 CEST 2010


Antoine Pitrou <pitrou at free.fr> added the comment:

Some comments:
- your ssl_convert_filename() function has a strange signature
- using PyByteArray_AsString() is wrong, we release the GIL later and the buffer could be reallocated, leading to a crash; the right approach is to use PyObject_GetBuffer() and later PyBuffer_Release()
- as such, your function could simply return the bytes/bytearray PyObject *, and not fill the char * pointer
- adding tests for both the bytes and unicode cases would be nice

----------
nosy: +pitrou

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8477>
_______________________________________


More information about the Python-bugs-list mailing list