Skip to content
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

from __future__ import not available with subprocess debugging -c #642

Closed
belonesox opened this issue Jun 3, 2021 · 1 comment
Closed

Comments

@belonesox
Copy link

Environment data

  • VS Code version:
    Version: 1.56.2
    Commit: 054a9295330880ed74ceaedda236253b4f39a335
    Date: 2021-05-12T16:45:26.313Z
    Electron: 12.0.4
    Chrome: 89.0.4389.114
    Node.js: 14.16.0
    V8: 8.9.255.24-electron.0
    OS: Linux x64 5.11.22-100.fc32.x86_64

  • Extension version (available under the Extensions sidebar): v2021.5.842923320

  • OS and version: 5.11.22-100.fc32.x86_64 Fedora VERSION="32"

  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.8.10

  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A

  • Value of the python.languageServer setting: Default

Expected behaviour

Consider following gist
https://gist.github.com/belonesox/eb61ab3b31a0a5904f6ed7fa2840fb34

When we run it with python or "Run without debugging", all OK

[stas@stas-fomin-hp8770 wtf-future]$  cd /home/stas/projects/wtf-future ; /usr/bin/env /usr/bin/python /home/stas/.vscode/extensions/ms-python.python-2021.5.842923320/pythonFiles/lib/python/debugpy/launcher 42687 -- /home/stas/projects/wtf-future/wtf-future.py 
b'2222\n111\n'
b''
0

I got same results if I import debugpy, insert «breakpoint()», debugging with pdb, etc.

I expect same result, if I run this with "Start Debugging"

Actual behaviour

If I run this with "Start Debugging" I got

[stas@stas-fomin-hp8770 wtf-future]$  /usr/bin/env /usr/bin/python /home/stas/.vscode/extensions/ms-python.python-2021.5.842923320/pythonFiles/lib/python/debugpy/launcher 34191 -- /home/stas/projects/wtf-future/wtf-future.py 
b''
b'  File "<string>", line 2\nSyntaxError: from __future__ imports must occur at the beginning of the file\n'
1

Steps to reproduce:

@karthiknadig karthiknadig transferred this issue from microsoft/vscode-python Jun 4, 2021
@fabioz fabioz changed the title Something wrong with subprocess.Popen when debugging from __future__ import not available with subprocess debugging -c Jun 10, 2021
@fabioz
Copy link
Collaborator

fabioz commented Jun 10, 2021

I'll take a look at this.

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