summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEnrico Scholz <enrico.scholz@sigma-chemnitz.de>2025-11-12 12:48:47 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2026-02-16 09:52:34 +0000
commitc0ba29bb80de74b1de480c87f991097058efbfe6 (patch)
tree3531f1e9c49ff1d2d8c11b14b31b90858057de9a
parent727b18ba309ce16eac728c5e99f24829d29350c9 (diff)
downloadpoky-c0ba29bb80de74b1de480c87f991097058efbfe6.tar.gz
bitbake: knotty: fix TIOCGWINSZ call for Python 3.14 and later
Python 3.14 enforces stricter type and size checking for fcntl.ioctl() buffer arguments. The previous code passed a short 4-byte string ('1234') to TIOCGWINSZ, which worked by accident in older Python versions but causes a SystemError ("buffer overflow") in 3.14. TIOCGWINSZ expects an 8-byte (4x 16-bit) buffer corresponding to (rows, cols, xpix, ypix). Use an 8-byte bytes literal instead and unpack the first two values. Tested with Python 3.11, 3.13, and 3.14. (Bitbake rev: 9127359eb116827a1e0debe69f84e57717436847) Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 415e9e329cf8cc0c2caa01cba80c21cfac9e2414) Signed-off-by: Yoann Congal <yoann.congal@smile.fr> Signed-off-by: Paul Barker <paul@pbarker.dev> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/ui/knotty.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py
index 3784c93ad8..41a943adf8 100644
--- a/bitbake/lib/bb/ui/knotty.py
+++ b/bitbake/lib/bb/ui/knotty.py
@@ -131,7 +131,7 @@ class TerminalFilter(object):
131 def getTerminalColumns(self): 131 def getTerminalColumns(self):
132 def ioctl_GWINSZ(fd): 132 def ioctl_GWINSZ(fd):
133 try: 133 try:
134 cr = struct.unpack('hh', fcntl.ioctl(fd, self.termios.TIOCGWINSZ, '1234')) 134 cr = struct.unpack('hhhh', fcntl.ioctl(fd, self.termios.TIOCGWINSZ, b'12345678'))[0:2]
135 except: 135 except:
136 return None 136 return None
137 return cr 137 return cr