| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Eleanor Boyd (@eleanorjboyd) hey I think Icannot add label in this |
Sorry, something went wrong.
|
Eleanor Boyd (@eleanorjboyd) all cehcks are passed |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fixes #26039
PYTHONSTARTUP executes pythonrc.py's code directly inside the user's __main__ namespace rather than importing it as a module. That means PS1.__str__.__globals__ is the user's namespace — so shadowing any name it relies on at prompt-render time (int, sys, str, bool, original_ps1, get_last_command) breaks str(sys.ps1) and silently kills the prompt.
This captures the real objects into private _-prefixed aliases right after they're defined, before any user code runs, so later reassignment of those names in __main__ can't affect the prompt anymore.
How I tested:
Notes for reviewers: the fix is intentionally minimal (capture at definition time) rather than moving the class into a separate module, since pythonStartup.ts only ever copies the single pythonrc.py file to the PYTHONSTARTUP location — splitting into two files would require extension-side deployment changes.