From ced52862a1fca5e96b9118ce423e7c3bb2eee80c Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Fri, 12 Sep 2025 16:25:37 +0200 Subject: [PATCH] Fix inst id based line lookup in log_internal_cpp_errors() --- src/ifcopenshell-python/ifcopenshell/validate.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/validate.py b/src/ifcopenshell-python/ifcopenshell/validate.py index e1a88112ee..cc70e85374 100644 --- a/src/ifcopenshell-python/ifcopenshell/validate.py +++ b/src/ifcopenshell-python/ifcopenshell/validate.py @@ -359,10 +359,12 @@ def log_internal_cpp_errors( else: inst = next( ( - l + l.decode("ascii", errors="ignore").strip() for l in lines - if l.strip().startswith(f"#{instid}".encode("ascii")) - and re.sub(r"\s+", "", l).startswith(f"#{instid}=".encode("ascii")) + if l.strip().startswith(f"#{instid[0]}".encode("ascii")) + and re.sub(r"\s+".encode("ascii"), b"", l).startswith( + f"#{instid[0]}=".encode("ascii") + ) ), None, )