Skip to content

fix(python): do not render local variables in tracebacks - #264

Merged
Rome-1 merged 1 commit into
mainfrom
mayor-agent/typer-locals
Oct 2, 2026
Merged

Rome-1 merged 1 commit into
mainfrom
mayor-agent/typer-locals

Conversation

@Rome-1

@Rome-1 Rome-1 commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

Typer renders every frame's local variables in its pretty tracebacks by default.
This sets pretty_exceptions_show_locals=False on the root rafter app so an unhandled exception prints the stack and the error, without frame locals (which can include credentials).

Node is not affected.

Test

python/tests/test_traceback_no_locals.py runs rafter usage in a subprocess with a sentinel RAFTER_API_KEY and an unreachable proxy, so the command fails with an unhandled transport error.
It asserts the sentinel appears in neither stdout nor stderr.

  • Fails on main before the change, passes after.
  • Full Python suite: 1754 passed, 1 skipped.

Typer's pretty tracebacks print every frame's locals by default.
Request helpers keep credentials in locals, so an unhandled exception
could echo them to stderr. Turn show_locals off on the root app.

Adds a subprocess test that forces a transport failure and asserts a
sentinel credential never reaches stdout or stderr.
@Rome-1
Rome-1 merged commit 5a80d9f into main Oct 2, 2026
10 checks passed
@Rome-1
Rome-1 deleted the mayor-agent/typer-locals branch October 2, 2026 04:40
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