Is shutil.get_terminal_size useless?

Paul Moore p.f.moore at gmail.com
Mon Jan 30 05:31:59 EST 2017


On Monday, 30 January 2017 05:37:32 UTC, Steven D'Aprano  wrote:
> On Monday 30 January 2017 08:12, Serhiy Storchaka wrote:
> 
> > On 28.01.17 10:03, Steve D'Aprano wrote:
> >> Is shutil.get_terminal_size useless? When, if ever, should I use it in
> >> preference to the os version? If the shutil version is broken, can it be
> >> fixed?
> > 
> > Read the history of shutil.get_terminal_size(). All this was discussed.
> 
> 
> Yes, it was discussed, but not resolved: Antoine Pitrou just closed the task 
> and declared it done, without resolving the failures I am talking about here.
> 
> http://bugs.python.org/issue13609
> 
> (Thanks Eryk Sun for the link.)


Looks like it was closed with the comment "If you want further features, please open a new issue". It sounds to me like os.get_terminal_size() does what you want, and others find the shutil version useful. But if you have a use case for the shutil version that needs a change in its behaviour, I guess you should open an issue for that.

The docs on shutil.get_terminal_size seem pretty clear on what it does (whether you agree with the behaviour or not), so I don't think there's much benefit to proposing changes to the docs alone.

Paul



More information about the Python-list mailing list