Repository navigation
Commit 7cd9ef3
authored
PyREPL: Send PS1 as string (#26197)
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.1 parent a501428 commit 7cd9ef3
2 files changed
Lines changed: 34 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
18 | 29 | | |
19 | 30 | | |
20 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
118 | 141 | | |
119 | 142 | | |
120 | 143 | | |
| |||
0 commit comments