Message283807
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. |
|
Date |
User |
Action |
Args |
2016-12-22 04:36:28 | Dolda2000 | set | recipients:
+ Dolda2000 |
2016-12-22 04:36:28 | Dolda2000 | set | messageid: <1482381388.92.0.462077532018.issue29042@psf.upfronthosting.co.za> |
2016-12-22 04:36:28 | Dolda2000 | link | issue29042 messages |
2016-12-22 04:36:27 | Dolda2000 | create | |
|