Skip to content

pdo: handle none cob_id correctly in __repr__#640

Open
stoicfeats wants to merge 1 commit intocanopen-python:masterfrom
stoicfeats:fix-pdo-repr-crash
Open

pdo: handle none cob_id correctly in __repr__#640
stoicfeats wants to merge 1 commit intocanopen-python:masterfrom
stoicfeats:fix-pdo-repr-crash

Conversation

@stoicfeats
Copy link
Copy Markdown

@stoicfeats stoicfeats commented Apr 16, 2026

fxes a crash when calling repr() on a pdomap that doesn't have a cob_id assigned yet.

before this, working in an interactive session would throw a typeerror if we evaluated uninitialized maps like node.rpdo[1].
the string formatter was trying to apply : X hex-formatting to a nonetype value.

this adds a quick inline fallback so it prints "unassigned" instead of throwing error on the console.

@stoicfeats
Copy link
Copy Markdown
Author

@acolomb please have a look into this, thanks.

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.

1 participant