On 2018-05-31, Paul Moore <[email protected]> wrote:
> On 31 May 2018 at 15:01, Chris Angelico <[email protected]> wrote:
>> Can someone on Windows see if there are other path names that raise
>> ValueError there? Windows has a whole lot more invalid characters, and
>> invalid names as well.
>
> On Windows:
>
>>>> os.path.exists('\0')
> ValueError: stat: embedded null character in path
>
>>>> os.path.exists('?')
> False
>
>>>> os.path.exists('\u77412')
> False
>
>>>> os.path.exists('\t')
> False
>
> Honestly, I think the OP's point is correct. os.path.exists should
> simply return False if the filename has an embedded \0 - at least on
> Unix.
Except on the platform in quetion filenames _don't_ contain an
embedded \0. What was passed was _not_ a path/filename.
You might as well have passed a floating point number or a dict.
> Although I wouldn't consider this as anything even remotely like a
> significant issue...
Agreed, but the thread will continue for months and generate hundreds
of followup.
--
Grant Edwards grant.b.edwards Yow! You were s'posed
at to laugh!
gmail.com
--
https://mail.python.org/mailman/listinfo/python-list