1

I'm running Python code in VS Code (1.28.2, with the Python, and Python Extension Pack extensions) and am using the 'Run Selection/Line in Python Terminal' (Shift+Enter) functionality to just run selected code in the Python terminal.

This has always worked well, but today I'm getting a new line added between each line of code in the terminal, i.e. if I ran:

import heapq 
import pickle

the output in the terminal would be:

>>>import heapq
>>>
>>>import pickle

At first, this just seems like an annoyance, but any for loops or functions now come out with an indentation error...so essentially I can't successfully run any code.

I've tried re-installing VS Code as well as installing an older version of VS Code but all give the same problem.

It's so odd because it was working fine and then all of a sudden it changed. The only thing I can think of that has possibly changed is I installed the JSON Tools extension, but I don't believe this would change anything within Python (and I've tried uninstalling this, and not loading it again when reinstalling VS Code from scratch)

Any help would be greatly appreciated!

4
  • This sounds like a bug that should be a github issue in the VS code repo and not a SO question. Commented Oct 18, 2018 at 12:07
  • Before reinstalling, did you try to delete the VS Code folder located by default in %APPDATA%\Code\User\ ? (see here for default locations of other OSes) Commented Oct 18, 2018 at 12:13
  • Yes, I did remove the.vscode folder (which contained the extensions) to ensure I started from a clean slate. It seems like an error with an update of the Python extension so as per @DeepSpace's comment, I will look to post on the VS repo, or more specifically the Python extension issues page. Thanks! Commented Oct 18, 2018 at 12:17
  • It is a bug that has a fix that will go out in a point release shortly: github.com/Microsoft/vscode-python/issues/2857 Commented Oct 18, 2018 at 19:05

1 Answer 1

0

It's a bug that will be fixed in the 2018.9.1 release of the Python extension.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.