Message323847
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)`. |
|
Date |
User |
Action |
Args |
2018-08-21 22:16:21 | eryksun | set | recipients:
+ eryksun, vstinner, Arfrever, zbysz, denilsonsa, grantjenks |
2018-08-21 22:16:21 | eryksun | set | messageid: <1534889781.27.0.56676864532.issue14841@psf.upfronthosting.co.za> |
2018-08-21 22:16:21 | eryksun | link | issue14841 messages |
2018-08-21 22:16:21 | eryksun | create | |
|