Message249040
FYI, the size of the terminal associated with the C's stdout isn't related to the IDLE shell. For example, in Linux when I run IDLE from the GUI, the associated terminal size is 0x0.
On Windows, os.get_terminal_size uses the console API GetConsoleScreenBufferInfo. This can't work given IDLE has no attached console. Also, for a GUI app the Windows C runtime leaves the standard FILE streams uninitialized to an invalid file descriptor (-1), so Python's sys.__stdout__ is None. That's why you get an AttributeError complaining that NoneType (i.e. type(None)) has no attribute 'fileno'.
Currently shutil.get_terminal_size returns the fallback size when os.get_terminal_size(sys.__stdout__.fileno()) raises NameError or OSError. I think AttributeError and ValueError should be added to this list. |
|
Date |
User |
Action |
Args |
2015-08-24 05:20:32 | eryksun | set | recipients:
+ eryksun, paul.moore, tim.golden, zach.ware, steve.dower, isaacl |
2015-08-24 05:20:32 | eryksun | set | messageid: <1440393632.17.0.281731302504.issue24920@psf.upfronthosting.co.za> |
2015-08-24 05:20:32 | eryksun | link | issue24920 messages |
2015-08-24 05:20:31 | eryksun | create | |
|