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 steve.dower
Recipients aldwinaldwin, larry, paul.moore, steve.dower, tim.golden, zach.ware, zufuliu
Date 2019-07-01.16:22:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1561998155.73.0.613237012581.issue37436@roundup.psfhosted.org>
In-reply-to
Content
You use this by getting the file descriptor/fileno for an open file, and then testing whether it's a file or not:

>>> f=open("python.bat")
>>> f.fileno()
3
>>> import os
>>> os.path.isfile(3)
True

This is very uncommon on Windows to begin with (file descriptors are emulated by the C Runtime for POSIX compatibility), but it is supported.

Enabling Modules/posixmodule.c#L2446 to be able to optionally handle the OverflowError would allow the "exists" type functions to just return False instead of raising, while letting the others continue to raise.

I'm going to mark this as "easy (C)" so that we consider it for sprints. But in principle, I'm okay with returning False for invalid values in exists-type functions rather than raising.
History
Date User Action Args
2019-07-01 16:22:35steve.dowersetrecipients: + steve.dower, paul.moore, larry, tim.golden, zach.ware, aldwinaldwin, zufuliu
2019-07-01 16:22:35steve.dowersetmessageid: <1561998155.73.0.613237012581.issue37436@roundup.psfhosted.org>
2019-07-01 16:22:35steve.dowerlinkissue37436 messages
2019-07-01 16:22:35steve.dowercreate