Every time I edit a Python script with VSC it ruins the shebang. If I manually fix it via sed
or even nano, it works but if I edit anything in the script with VSC(any line) and then try to execute the script, I get the bad interpreter error ./marshal.py: bad interpreter: /bin/python3^M: no such file or directory
.
Anyone have any ideas ?
Edit:
So I am editing this script in Windows via VSC but executing it in WSL. Fixing the shebang in WSL works but as soon as I edit it with VSC again it breaks the shebang
CodePudding user response:
Clicking on it lets you change it to LF
:
After saving the file it is executable in a Linux environment.