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

Vscode is auto launching morse beacuse of shebang in python file #11687

Closed
aleksglo opened this issue May 8, 2020 · 7 comments
Closed

Vscode is auto launching morse beacuse of shebang in python file #11687

aleksglo opened this issue May 8, 2020 · 7 comments
Assignees
Labels
area-environments Features relating to handling interpreter environments bug Issue identified by VS Code Team member as probable bug

Comments

@aleksglo
Copy link

aleksglo commented May 8, 2020

Environment data

  • VS Code version: 1.45.0
  • Extension version (available under the Extensions sidebar): 2020.4.76186
  • OS and version: Ubuntu 18.04.04
  • Python version : 3.6.9
  • Type of virtual environment used: no environment

Expected behavior

After editing and saving a python file with a shebang no external application should be launched.

Actual behavior

After saving a python file with the shebang "#! /usr/bin/env morseexec" Morse/Blender is executed.
It should not be executed automatically, vscode should just save the file.

This behavior is happening with this file for example
https://github.com/morse-simulator/morse/blob/master/examples/tutorials/ros_navigation/default.py

Steps to reproduce:

You can reproduce this by running the tutorial from here
https://www.openrobots.org/morse/doc/stable/user/installation.html
and try to edit https://github.com/morse-simulator/morse/blob/master/examples/tutorials/ros_navigation/default.py in vscode.

@aleksglo aleksglo added triage-needed Needs assignment to the proper sub-team bug Issue identified by VS Code Team member as probable bug labels May 8, 2020
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label May 11, 2020
@karrtikr
Copy link

Hi @A-l-e-k-s-G

Can you please send the logs from the Python output channel mentioned in the issue template? It contains the commands extension runs, which maybe leading to this. I am interested in the commands sent by the extension upon saving the file.
Please try running the commands logged just after you saved the file in terminal manually, and see which one launches the morse.

@karrtikr karrtikr added the info-needed Issue requires more information from poster label May 12, 2020
@karrtikr
Copy link

karrtikr commented May 12, 2020

I see the following being executed on saving the file

/usr/bin/env morseexec c:\Users\karraj\.vscode\extensions\ms-python.python-2020.5.78807\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"

I assume that's what you were talking about @A-l-e-k-s-G ? Also please send your settings.json.

@karrtikr karrtikr added feature-* and removed info-needed Issue requires more information from poster triage labels May 12, 2020
@karrtikr karrtikr assigned karrtikr and unassigned karrtikr May 12, 2020
@karrtikr karrtikr added triage info-needed Issue requires more information from poster and removed info-needed Issue requires more information from poster triage labels May 12, 2020
@karrtikr karrtikr removed their assignment May 12, 2020
@aleksglo
Copy link
Author

aleksglo commented May 12, 2020

Must be the line you mentioned, i guess.

settings.json ws

{
    "python.pythonPath": "/usr/bin/python3"
}

settings.json user

{
    "files.autoSave": "onFocusChange",
    "editor.minimap.enabled": false,
    "C_Cpp.updateChannel": "Insiders",
    "workbench.editor.enablePreview": false,
    "python.diagnostics.sourceMapsEnabled": true
}

Logs

console.ts:137 [Extension Host] Info Python Extension: 2020-05-12 23:13:21: Cached data exists getEnvironmentVariables, /home/uni/software_integration/morse/fourwd/default.py
console.ts:137 [Extension Host] Info Python Extension: 2020-05-12 23:13:21: > /usr/bin/env morseexec ~/.vscode/extensions/ms-python.python-2020.5.78807/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
console.ts:137 [Extension Host] Info Python Extension: 2020-05-12 23:13:24: Cached data exists getEnvironmentVariables, /home/uni/software_integration/morse/fourwd/default.py
console.ts:137 [Extension Host] Info Python Extension: 2020-05-12 23:13:24: > /usr/bin/python3 ~/.vscode/extensions/ms-python.python-2020.5.78807/pythonFiles/pyvsc-run-isolated.py pylint --disable=all --enable=F,unreachable,duplicate-key,unnecessary-semicolon,global-variable-not-assigned,unused-variable,unused-wildcard-import,binary-op-exception,bad-format-string,anomalous-backslash-in-string,bad-open-mode,E0001,E0011,E0012,E0100,E0101,E0102,E0103,E0104,E0105,E0107,E0108,E0110,E0111,E0112,E0113,E0114,E0115,E0116,E0117,E0118,E0202,E0203,E0211,E0213,E0236,E0237,E0238,E0239,E0240,E0241,E0301,E0302,E0303,E0401,E0402,E0601,E0602,E0603,E0604,E0611,E0632,E0633,E0701,E0702,E0703,E0704,E0710,E0711,E0712,E1003,E1101,E1102,E1111,E1120,E1121,E1123,E1124,E1125,E1126,E1127,E1128,E1129,E1130,E1131,E1132,E1133,E1134,E1135,E1136,E1137,E1138,E1139,E1200,E1201,E1205,E1206,E1300,E1301,E1302,E1303,E1304,E1305,E1306,E1310,E1700,E1701 --msg-template='{line},{column},{category},{symbol}:{msg}' --reports=n --output-format=text ~/software_integration/morse/fourwd/default.py
console.ts:137 [Extension Host] Info Python Extension: 2020-05-12 23:13:24: cwd: ~/software_integration
console.ts:137 [Extension Host] Info Python Extension: 2020-05-12 23:13:24: > /usr/bin/python3 ~/.vscode/extensions/ms-python.python-2020.5.78807/pythonFiles/pyvsc-run-isolated.py pylint --disable=all --enable=F,unreachable,duplicate-key,unnecessary-semicolon,global-variable-not-assigned,unused-variable,unused-wildcard-import,binary-op-exception,bad-format-string,anomalous-backslash-in-string,bad-open-mode,E0001,E0011,E0012,E0100,E0101,E0102,E0103,E0104,E0105,E0107,E0108,E0110,E0111,E0112,E0113,E0114,E0115,E0116,E0117,E0118,E0202,E0203,E0211,E0213,E0236,E0237,E0238,E0239,E0240,E0241,E0301,E0302,E0303,E0401,E0402,E0601,E0602,E0603,E0604,E0611,E0632,E0633,E0701,E0702,E0703,E0704,E0710,E0711,E0712,E1003,E1101,E1102,E1111,E1120,E1121,E1123,E1124,E1125,E1126,E1127,E1128,E1129,E1130,E1131,E1132,E1133,E1134,E1135,E1136,E1137,E1138,E1139,E1200,E1201,E1205,E1206,E1300,E1301,E1302,E1303,E1304,E1305,E1306,E1310,E1700,E1701 --msg-template='{line},{column},{category},{symbol}:{msg}' --reports=n --output-format=text ~/software_integration/morse/fourwd/default.py
console.ts:137 [Extension Host] Info Python Extension: 2020-05-12 23:13:24: cwd: ~/software_integration

@karrtikr
Copy link

/usr/bin/env morseexec ~/.vscode/extensions/ms-python.python-2020.5.78807/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"

Can you try running this manually in terminal and see if it's launching morse for you?

@aleksglo
Copy link
Author

Yes, the command is launching it.

@luabud luabud added area-environments Features relating to handling interpreter environments and removed feature-* labels May 13, 2020
@karrtikr karrtikr self-assigned this May 14, 2020
@karrtikr
Copy link

@A-l-e-k-s-G As a workaround you can either add "editor.codeLens": false to your user settings, or you can add "python.jediEnabled": false. I am working on the fix now.

@karrtikr
Copy link

This should be fixed in the next release.

@ghost ghost removed the needs PR label May 19, 2020
@karrtikr karrtikr added the P0 label May 19, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-environments Features relating to handling interpreter environments bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

4 participants