Skip to contentSkip to conversation

[2.8][PATCH 0/1] Patch review

bitbake Yoann Congal 1 participant 2 messages Mar 7

lore
Share & tools
lore
#0 lore raw

Please review this set of changes for 2.8/scarthgap and have comments back by end of day Tuesday, March 10.

Passed a-full on autobuilder:
https://autobuilder.yoctoproject.org/valkyrie/#/builders/29/builds/3349
(Ignore the warning about Centos Stream9, its support is a work in progress)

The following changes since commit 10118785e4a670bce4980e1044c0888a8b6e84af:

knotty: Make sure getTerminalColumns() returns two integers (2026-02-13 08:48:40 +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 bebecffef63a3ac60420b5347d549f71b00dc151:

COW: Fix hardcoded magic numbers and work with python 3.13 (2026-03-06 21:15:02 +0100)

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

Richard Purdie (1):
COW: Fix hardcoded magic numbers and work with python 3.13

 lib/bb/COW.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
#1 lore raw

[bitbake][scarthgap][2.8][PATCH 1/1] COW: Fix hardcoded magic numbers and work with python 3.13

From: Richard Purdie <[email protected]>

The COW tests started failing on python 3.13. Looks like it is time to fix the FIXME and drop the magic numbers!

(cherry picked from commit 2e6608cec508b3b9bab3530f83e70665ff638182)

[YC: This fixes the bb.tests.cow.COWTestCase.testOriginalTestSuite bitbake-selftest on the newly added fedora-41 workers]

---
 lib/bb/COW.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
lib/bb/COW.py +6 -4
index 76bc08a3e..4af03c54a 100644
@@ -36,8 +36,9 @@ class COWDictMeta(COWMeta):
     __marker__ = tuple()
 
     def __str__(cls):
-        # FIXME: I have magic numbers!
-        return "<COWDict Level: %i Current Keys: %i>" % (cls.__count__, len(cls.__dict__) - 3)
+        ignored_keys = set(["__count__", "__doc__", "__module__", "__firstlineno__", "__static_attributes__"])
+        keys = set(cls.__dict__.keys()) - ignored_keys
+        return "<COWDict Level: %i Current Keys: %i>" % (cls.__count__, len(keys))
 
     __repr__ = __str__
 
@@ -161,8 +162,9 @@ class COWDictMeta(COWMeta):
 
 class COWSetMeta(COWDictMeta):
     def __str__(cls):
-        # FIXME: I have magic numbers!
-        return "<COWSet Level: %i Current Keys: %i>" % (cls.__count__, len(cls.__dict__) - 3)
+        ignored_keys = set(["__count__", "__doc__", "__module__", "__firstlineno__", "__static_attributes__"])
+        keys = set(cls.__dict__.keys()) - ignored_keys
+        return "<COWSet Level: %i Current Keys: %i>" % (cls.__count__, len(keys))
 
     __repr__ = __str__