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

Python3.13 All functions fail to send: IndentationError: unexpected indent #24256

Open
karthiknadig opened this issue Oct 5, 2024 Discussed in #24222 · 10 comments
Open

Python3.13 All functions fail to send: IndentationError: unexpected indent #24256

karthiknadig opened this issue Oct 5, 2024 Discussed in #24222 · 10 comments
Assignees
Labels
area-repl bug Issue identified by VS Code Team member as probable bug
Milestone

Comments

@karthiknadig
Copy link
Member

Discussed in #24222

Originally posted by ddxv October 2, 2024
I recently fired up Python3.13rc2 but quickly found that any lines I send to the terminal do not work, specifically anything with additional line breaks or with indentation.

The new REPL, as I'm sure you know, autoindents for users. So it appears I'm getting a new indent for each line + the existing indent, causing a deeper and deeper indent even on a flat function. As you can see in the screenshot:
image

This inevitably leads to: IndentationError: unexpected indent

I'm opening a discussion because I don't see others mentioning this for Python 3.13, so I was not sure if this is actually a bug or something unique to my settings?

If others are encountering this, happy to turn this into a ticket.

@karthiknadig karthiknadig added the bug Issue identified by VS Code Team member as probable bug label Oct 5, 2024
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Oct 5, 2024
@Friendly-Mushrooom
Copy link

I am experiencing the same.

Version: 1.94.2 (system setup)
Commit: 384ff7382de624fb94dbaf6da11977bba1ecd427
Date: 2024-10-09T16:08:44.566Z
Electron: 30.5.1
ElectronBuildId: 10262041
Chromium: 124.0.6367.243
Node.js: 20.16.0
V8: 12.4.254.20-electron.0
OS: Windows_NT x64 10.0.26100
python: 3.13.0

@MMateo1120
Copy link

Same behaviour and error, only happens with python 3.13, 3.12 works fine.

@anthonykim1
Copy link

Thanks for the bug report! We investigate issues in order based on priority and severity, which includes the impact it has on your ability to use the extension to do productive work, and the number of people affected. If other users come forward and leave a comment demonstrating they are seeing/reproducing the problem then we will raise this issue's priority. Thanks for understanding and the patience!

Please go ahead and upvote this meanwhile so that we can further acknowledge the severity.

@Friendly-Mushrooom
Copy link

Friendly-Mushrooom commented Oct 17, 2024

Regarding severity, it greatly inhibited my ability to do work. Testing individual blocks of code is no longer a viable option for me. I cannot copy paste, I cannot shift+enter, I cannot right click and run in interactive window... I have to modify the python code, then to non-interactively test I run the entire program that calls the python. Dramatic decrease in productivity as a result of tedious testing and debugging.

@teuncm
Copy link

teuncm commented Oct 18, 2024

For me and students of our classes the impact is also huge. We teach the first steps of Python programming by letting them run blocks of code using shift+enter, but with the new behavior this is no longer an option at all.

@cbrnr
Copy link

cbrnr commented Oct 24, 2024

I just wanted to add that this also severely impacts how I use Python 3.13 in Visual Studio Code. For those looking for a workaround (other than downgrading Python to ≤ 3.12 or setting the env variable PYTHON_BASIC_REPL=1, which are both not good options), is to use the "Native REPL" (enable in the settings).

@cbrnr
Copy link

cbrnr commented Oct 24, 2024

BTW, just to let Windows users know that this currently does not work in Windows Terminal either, see python/cpython#124119. Not sure if it help resolving the issue here though.

@masai2018
Copy link

I updated VS Code to the most updated version (1.95.0) but still have the same error with Python 3.13 on Windows and Mac OS.

@anthonykim1
Copy link

Thanks @cbrnr for

(other than downgrading Python to ≤ 3.12 or setting the env variable PYTHON_BASIC_REPL=1, which are both not good options), is to use the "Native REPL" (enable in the settings).

Thanks everyone for the feedback here. Team is actively looking into resolving this, but please try out the "Native REPL" setting to send code and execute in Native REPL instead of terminal meanwhile.

@anthonykim1 anthonykim1 added this to the November 2024 milestone Oct 29, 2024
@anthonykim1
Copy link

@cbrnr The type of indentation error we can get seems very similar from what you mentioned python/cpython#124096 (issue from referenced PR). I think the indentation problem is not contained for just windows as we are experiencing for MacOS and linux too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-repl bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

7 participants