[issue13848] io.open() doesn't check for embedded NUL characters

Antoine Pitrou report at bugs.python.org
Tue Jan 24 14:20:50 CET 2012


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

Yes, fixing the conversion block is probably the right approach.
Apparently posixmodule.c uses PyUnicode_FSConverter, perhaps that would work?
(also make sure that the case where a bytes string is given is fixed too:

>>> open(b"\x00")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
FileNotFoundError: [Errno 2] No such file or directory: ''
)

----------

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


More information about the Python-bugs-list mailing list