Skip to content

Handle broken repr in tracing#666

Open
ShipItAndPray wants to merge 1 commit intopytest-dev:mainfrom
ShipItAndPray:fix-424-safe-tracing
Open

Handle broken repr in tracing#666
ShipItAndPray wants to merge 1 commit intopytest-dev:mainfrom
ShipItAndPray:fix-424-safe-tracing

Conversation

@ShipItAndPray
Copy link
Copy Markdown

Summary

  • guard tracing stringification so hook tracing does not break hook execution when traced objects have a broken __repr__/__str__
  • keep the fallback output informative by using the default object repr and the original exception
  • add a regression test covering broken repr values in traced hook kwargs

Testing

  • uv run --python 3.12 pytest testing/test_pluginmanager.py -k broken_repr -q
  • uv run --python 3.12 pytest testing/test_pluginmanager.py -q

Closes #424.

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.

Avoid erroring from tracing

2 participants