This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eric.smith
Recipients eric.smith, mrabarnett, pacujo, r.david.murray
Date 2018-06-01.16:53:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1527871985.01.0.81473610881.issue33721@psf.upfronthosting.co.za>
In-reply-to
Content
I don't know of any OS that supports NULs in filenames (not that my knowledge is encyclopedic).

My reason for suggesting we document it is that os.path.exists() returns False for otherwise invalid filenames, where something like open() raises. On Windows:

>>> os.path.exists('c::bar')
False

>>> open('c::bar')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: [Errno 22] Invalid argument: 'c::bar'

So I do think it's a little surprising that os.path.exists() would raise with a NUL, instead of returning False. But I don't think it's worth changing the behavior, due to potential (though unlikely) breakage.
History
Date User Action Args
2018-06-01 16:53:05eric.smithsetrecipients: + eric.smith, mrabarnett, r.david.murray, pacujo
2018-06-01 16:53:05eric.smithsetmessageid: <1527871985.01.0.81473610881.issue33721@psf.upfronthosting.co.za>
2018-06-01 16:53:04eric.smithlinkissue33721 messages
2018-06-01 16:53:04eric.smithcreate