With python3.14 result = fcntl.ioctl(sys.stdout, termios.TIOCGWINSZ, buf) can also raise a SystemError which is not handelnd. Please add it to the except clause
|
try: |
|
result = fcntl.ioctl(sys.stdout, termios.TIOCGWINSZ, buf) |
|
# Unpack buffer back into Python data types |
|
# NOTE: this unpack gives us rows x cols, but we return the |
|
# inverse. |
|
rows, cols = struct.unpack(fmt, result) |
|
return (cols, rows) |
|
# Fallback to emptyish return value in various failure cases: |
|
# * sys.stdout being monkeypatched, such as in testing, and lacking |
|
# * .fileno |
|
# * sys.stdout having a .fileno but not actually being attached to a |
|
# * TTY |
|
# * termios not having a TIOCGWINSZ attribute (happens sometimes...) |
|
# * other situations where ioctl doesn't explode but the result isn't |
|
# something unpack can deal with |
|
except (struct.error, TypeError, IOError, AttributeError): |
|
pass |
|
return size |
Python changelog: https://docs.python.org/3.14/whatsnew/changelog.html#id13
With python3.14
result = fcntl.ioctl(sys.stdout, termios.TIOCGWINSZ, buf)can also raise a SystemError which is not handelnd. Please add it to the except clauseinvoke/invoke/terminals.py
Lines 95 to 112 in 2a8f95f
Python changelog: https://docs.python.org/3.14/whatsnew/changelog.html#id13