| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…REPL use Users may be able to assign non-string, but string representable values to ps1, but these should be converted to their string representations before use by PyREPL rendering.
|
It would be good to fix original issue as well. |
Sorry, something went wrong.
…ibO9V.rst Co-authored-by: Brett Cannon <brett@python.org>
Improve the integration of prompt handling in the REPL, ensuring that prompts are always passed as strings to `_pyrepl.simple_interact.multiline_input` * In `python_files/pythonrc.py`, patch `_pyrepl.simple_interact.multiline_input` so that the `ps1` and `ps2` prompt arguments are always converted to strings before being passed, preventing issues with non-string prompt objects (see python/cpython#158828) ### Testing * Adds a new test `test_pyrepl_multiline_input_converts_prompts_to_strings` in `python_files/tests/test_shell_integration.py` to verify that the patched `multiline_input` function correctly converts prompt arguments to strings before calling the original function.
|
@sergey-miryanov we need a fix for the str usage as it's causes issues in VS Code, so I would rather get this targeted fix in now while we wait to get a decision on what to do in the face of exceptions back on the original issue. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Users may be able to assign non-string, but string representable values to sys.ps1 or sys.ps2, but these should be converted to their string representations before use by PyREPL rendering.
Otherwise, for users assigning non-string objects, or using tools like VSCode, the REPL overflows with errors.