When sys.argv be changed, pudb3 cannot enter REPL
Describe the bug When sys.argv be changed, pudb3 cannot enter REPL
To Reproduce test.py
import sys
argv = sys.argv
sys.argv = []
print(1)
print(2)
print(3)
sys.argv = argv
print(4)
print(5)
print(6)
pudb3 test.py, when sys.argv is [], press ! cannot enter REPL. when sys.argv recovery, press ! can enter REPL.
Expected behavior
press ! can enter REPL.
Additional context
Can we backup sys.argv when the program start, And when we press ! recover sys.argv temporarily to avoid this bug?
Complete:
if some module of sys.modules (e.g, argparse) be changed, the same phenomenon will also happen.
When you say, "cannot enter the REPL", what's the symptom?
It probably depends on the REPL being used. IPython seems to work OK for me, but it does break other repls. This could perhaps be considered a bug in the specific repls, although I'm unclear why you would clear sys.argv like this. I would expect that in general that messing around with sys globals is going to break things.
but it does break other repls
I use ptpython.
what's the symptom
Press ! can not enter the ptpyhon's REPL.
I'm unclear why you would clear sys.argv like this
Some code do it and I just test and found this bug. :smile:
IPython seems to work OK for me, but it does break other repls
I have tested and found it seems that only ptpython has this problem. So I guess it is the bug of upstream.