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 eryksun, isaacl, paul.moore, steve.dower, tim.golden, zach.ware
Date 2015-08-24.05:20:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1440393632.17.0.281731302504.issue24920@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2015-08-24 05:20:32eryksunsetrecipients: + eryksun, paul.moore, tim.golden, zach.ware, steve.dower, isaacl
2015-08-24 05:20:32eryksunsetmessageid: <1440393632.17.0.281731302504.issue24920@psf.upfronthosting.co.za>
2015-08-24 05:20:32eryksunlinkissue24920 messages
2015-08-24 05:20:31eryksuncreate