On 31 May 2018 at 16:11, Steven D'Aprano <steve+comp.lang.pyt...@pearwood.info> wrote: > On Thu, 31 May 2018 22:46:35 +1000, Chris Angelico wrote: > [...] >>> Most other analogous reasons *don't* generate an exception, nor is that >>> possibility mentioned in the specification: >>> >>> https://docs.python.org/3/library/os.path.html?#os.path.exists >>> >>> Is the behavior a bug? Shouldn't it be: >>> >>> >>> os.path.exists("\0") >>> False >> >> A Unix path name cannot contain a null byte, so what you have is a >> fundamentally invalid name. ValueError is perfectly acceptable. > > It should still be documented. > > What does it do on Windows if the path is illegal?
Returns False (confirmed with paths of '?' and ':', among others). Paul -- https://mail.python.org/mailman/listinfo/python-list