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 eryksun
Recipients benjamin.peterson, collinanderson, eryksun, pitrou, serhiy.storchaka, stutzbach
Date 2021-12-01.11:53:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1638359593.4.0.00903354875923.issue45944@roundup.psfhosted.org>
In-reply-to
Content
> make it returning False without invoking a system call if the file
> size is non-zero it will eliminate the need to expose _size.

I suggest using the file type instead of the size. There's no reason to call isatty() if it's not an S_IFCHR file. This will avoid calling isatty() on regular files that happen to be empty.

In Windows, isatty(fd) is based solely on the file type, which is flagged in the fd record when a file descriptor is opened for a native file handle. It's not a system call, but it's also nearly worthless for how isatty() is typically used, since it's true for any S_IFCHR file (e.g. con, nul, com1).
History
Date User Action Args
2021-12-01 11:53:13eryksunsetrecipients: + eryksun, pitrou, benjamin.peterson, stutzbach, serhiy.storchaka, collinanderson
2021-12-01 11:53:13eryksunsetmessageid: <1638359593.4.0.00903354875923.issue45944@roundup.psfhosted.org>
2021-12-01 11:53:13eryksunlinkissue45944 messages
2021-12-01 11:53:13eryksuncreate