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

Run Selection/Line in python terminal broken after last update #2857

Closed
GPhilo opened this issue Oct 11, 2018 · 23 comments
Closed

Run Selection/Line in python terminal broken after last update #2857

GPhilo opened this issue Oct 11, 2018 · 23 comments
Labels
area-terminal bug Issue identified by VS Code Team member as probable bug windows

Comments

@GPhilo
Copy link

GPhilo commented Oct 11, 2018

Environment data

  • VS Code version: 1.28.0
  • Extension version (available under the Extensions sidebar): 2018.9.0
  • OS and version: Windows 10 1803, x64
  • Python version (& distribution if applicable, e.g. Anaconda): 3.6.6
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
  • Relevant/affected Python packages and their versions: -

Actual behavior

After the latest update of vscode, trying to execute any python block via shift+Enter appends an extra newline at the end of each line, which breaks execution of loops.

Expected behavior

The code runs in the terminal

Steps to reproduce:

  1. Copy the following in a python file:
print(32)
for i in range(4):
    print(i)
  1. Select and run via shift+enter

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

>>> for i in range(4):
...
  File "<stdin>", line 2

    ^
IndentationError: expected an indented block
>>>     print(i)
  File "<stdin>", line 1
    print(i)
    ^
IndentationError: unexpected indent
>>>

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)
(The following repeats multiple times, console was cleared before running, errors show only on the first run in a new terminal)

bootstrap-window.js:195 [uncaught exception]: TypeError: Cannot read property 'isWrapped' of undefined

c:\Users\Filippo\AppData\Local\Programs\Microsoft VS Code\resources\app\node_modules.asar\vscode-xterm\lib\Buffer.js:205 Uncaught TypeError: Cannot read property 'isWrapped' of undefined
    at Buffer.getWrappedRangeForLine (c:\Users\Filippo\AppData\Local\Programs\Microsoft VS Code\resources\app\node_modules.asar\vscode-xterm\lib\Buffer.js:205)
    at BufferStringIterator.next (c:\Users\Filippo\AppData\Local\Programs\Microsoft VS Code\resources\app\node_modules.asar\vscode-xterm\lib\Buffer.js:305)
    at Linkifier._linkifyRows (c:\Users\Filippo\AppData\Local\Programs\Microsoft VS Code\resources\app\node_modules.asar\vscode-xterm\lib\Linkifier.js:65)
    at c:\Users\Filippo\AppData\Local\Programs\Microsoft VS Code\resources\app\node_modules.asar\vscode-xterm\lib\Linkifier.js:53
@patrys
Copy link

patrys commented Oct 11, 2018

Aren't you missing a colon after the for loop?

@GPhilo
Copy link
Author

GPhilo commented Oct 11, 2018

@patrys Copy-paste mistake when writing the sample, the error is still there with the colon in place (the issue was updated)

@d3r3kk d3r3kk added bug Issue identified by VS Code Team member as probable bug needs verification area-terminal labels Oct 11, 2018
@d3r3kk
Copy link

d3r3kk commented Oct 11, 2018

I cannot reproduce this on Ubuntu 18.04, but there have been changes to the activation of conda environments specific to Windows. @DonJayamanne can you have a look on Windows?

@DonJayamanne
Copy link

I can replicate on Windows, but not Mac.

@rosjoh
Copy link

rosjoh commented Oct 11, 2018

I can confirm the same error on Windows.

@JeppeDruedahl
Copy link

I can also confirm the same error

@aminevsaziz
Copy link

aminevsaziz commented Oct 12, 2018

same for me!

@dataders
Copy link

confirm me and my coworker on Windows with Python 3.6 but not 2.6

@jmazar
Copy link

jmazar commented Oct 16, 2018

Same problem for me on Windows python 3.6.

@jsarneja
Copy link

I confirm the issue in windows10. Any idea by when this could be solved?

@brettcannon
Copy link
Member

@jsarneja no ETA as we're busy dealing with a nasty conda + PowerShell issue.

@sean-doody
Copy link

Confirmed on Windows, not on Mac.

@ChandanVerma
Copy link

Is the issue resolved? Finding the same issue on windows 10 python 3.6.5

@sean-doody
Copy link

Is the issue resolved? Finding the same issue on windows 10 python 3.6.5

Nope; not resolved. No ETA at the moment.

@DonJayamanne
Copy link

Hi everyone, we've created a fix for this, please could you download the development version and help us verify the fix.
Install instructions and fix can be downloaded here https://github.com/Microsoft/vscode-python/blob/master/CONTRIBUTING.md#development-build

@DonJayamanne
Copy link

@ChandanVerma @pomoneomarx

Please note the issue has been resolved, if you look above, you can see that a PR was merged yesterday to resolve this, we need to verify the fix, hope you can help with that.

@WayOfKings
Copy link

Installed the .vsix and restarted twice. Then ran some test code. Problem seems to persist. Ran line 11 first, then 13 to 15.
image

image
image
OS and version: Windows 7 Professional
image
Anaconda 3-5.3.0

@ajjitn
Copy link

ajjitn commented Oct 18, 2018

The development version works for me running the same code

test_vscode_python

test_vscode_python

OS and Version: Windows 10 Home
Python 3.6.5 64-bit
Anaconda 3-5.3.0

@WayOfKings
Copy link

WayOfKings commented Oct 18, 2018

It does work now that I noticed I had to manually click into the terminal box and hit enter for the output to appear. But having to do that every time on a Run Selection/Line is going to get inconvenient. Otherwise it just pauses on the 3 dots...
image

@ajjitn
Copy link

ajjitn commented Oct 18, 2018

Also noticed a new bug with the development version. Anytime I type something into a python script,the following error always pops up in the Output Pane

test_vscode_python

@sean-doody
Copy link

I am back in business with this Development Build fix. Thank you! I see others are noticing other bugs; I'll keep an eye out.

@aminevsaziz
Copy link

aminevsaziz commented Oct 18, 2018

@ChandanVerma @pomoneomarx

Please note the issue has been resolved, if you look above, you can see that a PR was merged yesterday to resolve this, we need to verify the fix, hope you can help with that.

@DonJayamanne this fix is:

  1. working ;)
  2. no "enter" is required after sending the code to the terminal.
  3. Using 'IPython' instead of 'python' work perfectly and doesn't require pressing "enter" at the end to validate.
  4. Thanks everyone for the fix its was an annoying bug that persist for months.

Details:
Windows 10, 8.1 and 8.1
Python 3.5, 3.6.6 and 3.7(64-bit all from Anaconda)

@brettcannon
Copy link
Member

FYI 2018.9.1 was just released with the fix for this!

@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-terminal bug Issue identified by VS Code Team member as probable bug windows
Projects
None yet
Development

No branches or pull requests