Skip to content

fix: use forwarded attribute lookups for SafeTextIO - #241

Merged
jeffersonngu merged 1 commit into
mainfrom
fix/textio-color
Jul 29, 2026
Merged

jeffersonngu merged 1 commit into
mainfrom
fix/textio-color

Conversation

@jeffersonngu

Copy link
Copy Markdown
Collaborator

No description provided.

@cursor

cursor Bot commented Jul 29, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Small transparency fix around attribute delegation; write/censoring path is unchanged.

Overview
SafeTextIO now delegates non-write attribute access to the underlying stream, so callers see real stream behavior (e.g. encoding, fileno) instead of empty typing.TextIO stubs.

The wrapper stores the original TextIO in __wrapped and implements __getattribute__ to resolve most names on that object while keeping write (and dunder lookups) on the wrapper for secret censoring. Class docstring explains why inheritance from TextIO alone is insufficient at runtime.

Reviewed by Cursor Bugbot for commit aec1b32. Bugbot is set up for automated code reviews on this repo. Configure here.

@jeffersonngu
jeffersonngu merged commit d4e9ba2 into main Jul 29, 2026
9 checks passed
@jeffersonngu
jeffersonngu deleted the fix/textio-color branch July 29, 2026 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants