Skip to content

Handle python option to read program from stdin when rewriting arguments to attach to subprocess #150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
guyingzhao opened this issue Oct 9, 2019 · 2 comments

Comments

@guyingzhao
Copy link

guyingzhao commented Oct 9, 2019

it's ok to execute via pydev run but failed via pydev debug, see:

pypa/virtualenv#1423

I think the fix may be restoring old sys.argv after rewritting command line

@fabioz
Copy link
Owner

fabioz commented Oct 9, 2019

It's probably trickier than that... the issue is that the option python - is not properly supported to automatically attach to subprocesses (python itself would read the stdin contents to execute that file).

i.e.: Output from python help:
- : program read from stdin (default; interactive mode if a tty)

So, if - is passed, pydevd needs to recognize that this option is passed to the python interpreter and do the same work it'd do after having the debugger setup in the subprocess.

@fabioz fabioz changed the title pydev debugger rewrite command line args got side effects Handle python option to read program from stdin when rewriting arguments to attach to subprocess Oct 9, 2019
@guyingzhao
Copy link
Author

Yes, it's tricker :).

I have fixed this locally by modify virtualenv.py and perhaps I will look for alternative way to resolve this later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants