Skip to content

fix: read yEd labels without the y: prefix (breaks with lxml 6.2.0) - #720

Merged
pradeeban merged 1 commit into
ControlCore-Project:devfrom
SahilKumar965:fix/lxml-6.2-labels
Nov 29, 2026
Merged

pradeeban merged 1 commit into
ControlCore-Project:devfrom
SahilKumar965:fix/lxml-6.2-labels

Conversation

@SahilKumar965

Copy link
Copy Markdown

lxml 6.2.0 (released Nov 27) changed how BeautifulSoup's xml parser keeps namespace prefixes. The y: prefix on yEd tags is lost, so every find("y:NodeLabel") / find("y:EdgeLabel") returns None.

Because of that, mkconcore finds no nodes (Languages detected in graph: set()), writes empty build/run scripts and still exits 0. concore validate and concore inspect miss every label too. CI installs the latest lxml, so dev currently fails 66 tests on every Python version, and fresh installs of concore are affected the same way.

Quick check:

from bs4 import BeautifulSoup
s = BeautifulSoup(open("demo/sample.graphml").read(), "xml")
n = s.find("node")
print(n.find("y:NodeLabel"))  # lxml 6.1.3: the tag, lxml 6.2.0: None
print(n.find("NodeLabel"))    # works on both

Fix: look the tags up without the prefix. That works on both lxml versions. 14 lookups in mkconcore.py, validate.py, inspect.py and build.py. graph.py already falls back to the plain name, and fri/server uses ElementTree with a namespace map, so neither needed changes.

Testing (full suite, lxml 6.2.0)

# without fix (dev)
66 failed, 414 passed

# with fix
7 failed, 473 passed     (the remaining 7 are fixed in #719)

# with fix + #719, Python 3.9 and 3.12
464 passed, 0 failed

ruff format --check . and ruff check . are clean.

@github-actions

Copy link
Copy Markdown

🎉 Welcome aboard, @SahilKumar965! Thank you for your first pull request in concore.

Please ensure that you are contributing to the dev branch.

Your contribution means a lot to us. We'll review it shortly.

Please ensure you have reviewed our:

If you have any questions, feel free to ask. Happy coding!

@pradeeban

Copy link
Copy Markdown
Member

@SahilKumar965 Pls check what is still failing in the CI. I understand we have yEd workflows left behind. But we have moved to using concore-editor exclusively. So at some point, we will stop caring about yEd workflows. Maybe not at this point.

lxml 6.2.0 drops the y: namespace prefix in BeautifulSoup's xml parser,
so find("y:NodeLabel") / find("y:EdgeLabel") return None. mkconcore then
finds no nodes and writes empty build/run scripts, and validate/inspect
miss every label. Looking the tags up by their plain name works on both
lxml 6.1.x and 6.2.0.
@SahilKumar965

Copy link
Copy Markdown
Author

Thanks for checking. The failures are the same 7 that were fixed in #719. This branch was created before #719 got merged. I've rebased it on the latest dev, so CI should pass now.

@pradeeban
pradeeban merged commit 6eb54d7 into ControlCore-Project:dev Nov 29, 2026
17 checks passed
@SahilKumar965
SahilKumar965 deleted the fix/lxml-6.2-labels branch November 29, 2026 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants