Skip to contentSkip to conversation

[2.8][PATCH 0/2] Patch review

bitbake Yoann Congal 1 participant 3 messages Feb 9

lore
Share & tools
lore
#0 lore raw

Please review this set of changes for scarthgap and have comments back by end of day Wednesday, February 11.

Passed a-full on autobuilder:
https://autobuilder.yoctoproject.org/valkyrie/#/builders/29/builds/3183

The following changes since commit 8dcf084522b9c66a6639b5f117f554fde9b6b45a:

fetch2/wget: Keep query parameters in URL during checkstatus (2025-11-12 15:53:31 +0000)

are available in the Git repository at:

https://git.openembedded.org/bitbake-contrib stable/2.8-nut
https://git.openembedded.org/bitbake-contrib/log/?h=stable/2.8-nut

for you to fetch changes up to 1b923cdd50449aaa41152b72eac8669f27ec7ec2:

knotty: Make sure getTerminalColumns() returns two integers (2026-02-09 01:22:13 +0100)

----------------------------------------------------------------

Enrico Scholz (1):
knotty: fix TIOCGWINSZ call for Python 3.14 and later

Zoltan Boszormenyi (1):
knotty: Make sure getTerminalColumns() returns two integers

 lib/bb/ui/knotty.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
#1 lore raw

[bitbake][scarthgap][2.8][PATCH 2/2] knotty: Make sure getTerminalColumns() returns two integers

From: Zoltan Boszormenyi <[email protected]>

Python 3.14 complains about these:

Traceback (most recent call last):
File "/mnt2/zozo/yocto-5.3/bitbake/lib/bb/ui/knotty.py", line 722, in main

    termfilter.updateFooter()
    ~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/mnt2/zozo/yocto-5.3/bitbake/lib/bb/ui/knotty.py", line 339, in updateFooter
    lines = self.getlines(content)
  File "/mnt2/zozo/yocto-5.3/bitbake/lib/bb/ui/knotty.py", line 370, in getlines
    lines = lines + 1 + int(len(line) / (self.columns + 1))
                                         ~~~~~~~~~~~~~^~~

TypeError: can only concatenate str (not "int") to str

and

Traceback (most recent call last):
File "/mnt2/zozo/yocto-5.3/bitbake/lib/bb/ui/knotty.py", line 722, in main

    termfilter.updateFooter()
    ~~~~~~~~~~~~~~~~~~~~~~~^^

File "/mnt2/zozo/yocto-5.3/bitbake/lib/bb/ui/knotty.py", line 341, in updateFooter
for tasknum, task in enumerate(tasks[:(self.rows - 1 - lines)]):
~~~~~~~~~~^~~
TypeError: unsupported operand type(s) for -: 'str' and 'int'

Make sure getting the number of rows and columns from the terminal via the environment variables LINES and COLUMNS are returned as a pair of integers. This matches the return value of ioctl_GWINSZ().

(cherry picked from commit a4e0b6f8077276a0bfb9d05c759bc752a84d1f76)
---
 lib/bb/ui/knotty.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/bb/ui/knotty.py +1 -1
index 41a943adf..5198e93d8 100644
@@ -145,7 +145,7 @@ class TerminalFilter(object):
                 pass
         if not cr:
             try:
-                cr = (os.environ['LINES'], os.environ['COLUMNS'])
+                cr = (int(os.environ['LINES']), int(os.environ['COLUMNS']))
             except:
                 cr = (25, 80)
         return cr
#2 lore raw

[bitbake][scarthgap][2.8][PATCH 1/2] knotty: fix TIOCGWINSZ call for Python 3.14 and later

In reply to Yoann Congal

From: Enrico Scholz <[email protected]>

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.

(cherry picked from commit 415e9e329cf8cc0c2caa01cba80c21cfac9e2414)
---
 lib/bb/ui/knotty.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/bb/ui/knotty.py +1 -1
index 3784c93ad..41a943adf 100644
@@ -131,7 +131,7 @@ class TerminalFilter(object):
     def getTerminalColumns(self):
         def ioctl_GWINSZ(fd):
             try:
-                cr = struct.unpack('hh', fcntl.ioctl(fd, self.termios.TIOCGWINSZ, '1234'))
+                cr = struct.unpack('hhhh', fcntl.ioctl(fd, self.termios.TIOCGWINSZ, b'12345678'))[0:2]
             except:
                 return None
             return cr