This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Dolda2000
Recipients Dolda2000
Date 2016-12-22.04:36:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1482381388.92.0.462077532018.issue29042@psf.upfronthosting.co.za>
In-reply-to
Content
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 "<stdin>", line 1, in <module>
  File "/usr/lib/python3.5/genericpath.py", line 19, in exists
    os.stat(path)
ValueError: embedded null byte

However, os.path.exists is supposed to be a predicate returning whether there exists a file named by the path; it does not specify any particular method or system call for doing the test, and so reflecting the behavior of the underlying syscall used is not obviously desirable. 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.
History
Date User Action Args
2016-12-22 04:36:28Dolda2000setrecipients: + Dolda2000
2016-12-22 04:36:28Dolda2000setmessageid: <1482381388.92.0.462077532018.issue29042@psf.upfronthosting.co.za>
2016-12-22 04:36:28Dolda2000linkissue29042 messages
2016-12-22 04:36:27Dolda2000create