Message323847
| 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)`. |
|