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? -- Steven D'Aprano "Ever since I learned about confirmation bias, I've been seeing it everywhere." -- Jon Ronson -- https://mail.python.org/mailman/listinfo/python-list