The 3.5 branch only gets security fixes at this point. Consider upgrading to 3.6. That said, this shouldn't be a problem with shutil.get_terminal_size() in 3.5. It handles AttributeError, ValueError, and OSError by returning the `fallback` size. And it's expected that `os.get_terminal_size(1)` will fail if there's no attached console.
Thanks for the report. I agree with Eryk. os.get_terminal_size() is a low-level function. shutil.get_terminal_size() should be used as documented at https://docs.python.org/3/library/os.html#os.get_terminal_size shutil.get_terminal_size() is the high-level function which should normally be used, os.get_terminal_size is the low-level implementation.
Thankyou for clearing that up! On 18 May 2018 at 13:05, Berker Peksag <report@bugs.python.org> wrote: > > Berker Peksag <berker.peksag@gmail.com> added the comment: > > Thanks for the report. I agree with Eryk. os.get_terminal_size() is a > low-level function. shutil.get_terminal_size() should be used as documented > at https://docs.python.org/3/library/os.html#os.get_terminal_size > > shutil.get_terminal_size() is the high-level function which should > normally be used, os.get_terminal_size is the low-level > implementation. > > ---------- > nosy: +berker.peksag > resolution: -> not a bug > stage: -> resolved > status: open -> closed > > _______________________________________ > Python tracker <report@bugs.python.org> > <https://bugs.python.org/issue32463> > _______________________________________ >
History
Date
User
Action
Args
2022-04-11 14:58:56
admin
set
github: 76644
2018-05-21 08:17:16
Dhruve
set
messages: +
2018-05-18 12:05:37
berker.peksag
set
status: open -> closednosy: + berker.peksagmessages: + resolution: not a bugstage: resolved