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 Arfrever, denilsonsa, eryksun, grantjenks, vstinner, zbysz
Date 2018-08-21.22:16:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1534889781.27.0.56676864532.issue14841@psf.upfronthosting.co.za>
In-reply-to
Content
The Windows implementation shouldn't map file-descriptor values 0, 1, and 2 to the process standard handles. fileno(stdout) may not even be 1 in some cases. It should use `handle = _get_osfhandle(fd)`, which is more generally correct and not limited to hard-coded defaults. 

Regarding this issue, the docs should clarify that the Windows console's input buffer cannot be used to get the screen buffer size. Typically the input buffer is STDIN_FILENO (0) or opened via  "CONIN$" or "CON" (read mode). Thus there is no point to checking stdin in Windows since it will always fail.

I agree that the default behavior should be extended to check a platform-dependent tty/console device. In Windows this is `fd = _open("CONOUT$", _O_RDWR)`.
History
Date User Action Args
2018-08-21 22:16:21eryksunsetrecipients: + eryksun, vstinner, Arfrever, zbysz, denilsonsa, grantjenks
2018-08-21 22:16:21eryksunsetmessageid: <1534889781.27.0.56676864532.issue14841@psf.upfronthosting.co.za>
2018-08-21 22:16:21eryksunlinkissue14841 messages
2018-08-21 22:16:21eryksuncreate