[issue29042] os.path.exists should not throw "Embedded NUL character" exception

2017-12-18 Thread STINNER Victor
STINNER Victor added the comment: > A path containing an embedded NUL character simply cannot name an existing > file, and therefore os.path.exists should return False for such a path. I disagree. Python doesn't call the syscall and so must raise a different exception. You must not pass a pa

[issue29042] os.path.exists should not throw "Embedded NUL character" exception

2016-12-22 Thread Christoph Reiter
Christoph Reiter added the comment: Raising in case no valid path is passed seems fine to me. There are other cases where it fails: python3 -c "import os; os.path.exists('\ud83d')" Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.5/genericpath.py", line 19, in

[issue29042] os.path.exists should not throw "Embedded NUL character" exception

2016-12-21 Thread Dolda2000
New submission from Dolda2000: Currently, calling os.path.exists on a path which contains NUL characters behaves consistently with most file-system calls by throwing an exception: >>> os.path.exists('\0') Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.5/gener