Why exception from os.path.exists()?

Chris Angelico rosuav at gmail.com
Sun Jun 10 21:12:24 EDT 2018


On Mon, Jun 11, 2018 at 11:06 AM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
> On Sun, 10 Jun 2018 23:57:35 +0200, Peter J. Holzer wrote:
>
>> I think this is worth keeping, and "I couldn't pass that file name to
>> the OS" is a different error than "the OS told me the file doesn't
>> exist", so I think it should be a different exception.
>
> What makes you think that NUL bytes are a fundamental limitation that no
> OS could every cope with?

I didn't say that. If you have an OS that can't handle more than 255
bytes of file name, it's allowed to raise ValueError just the same.

ChrisA



More information about the Python-list mailing list