You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Python3.13 All functions fail to send: IndentationError: unexpected indent #24256
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:
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.
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.
Reacted by MMateo1120, Alex Naglich, James O'Claire, Teun M, DuarteRedinha, Matthew Davidson, Felix, Ingri Katherine Quevedo Rocha, jrdnh, uqgrowan and 26 more
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.
Reacted by James O'Claire, Teun M, Fabien Cara, Ingri Katherine Quevedo Rocha, uqgrowan, JordyScript, Furkan Çelik, Bhargava Kotapalli, Jon Schwenk, AnisShl and 5 more
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.
Reacted by Anthony Kim, Ingri Katherine Quevedo Rocha, JordyScript, Furkan Çelik, Jon Schwenk and juankaniamorales
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).
Reacted by Richard Höchenberger, Anthony Kim, Peng Lyu, Nick, Furkan Çelik, Jon Schwenk, AnisShl and Laura Bakala
(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.
Reacted by Clemens Brunner, Teun M, Peng Lyu, Nick, Furkan Çelik and AnisShl
I'm having issues with this error as well. This is how I develop code, It will greatly impact on my performance. I'm using an older python version beause of this
Hi folks, I've resolved #25164 which would effectively bring you to the REPL that you are used to using, and you won't need to press extra enter in the terminal to run your command, or experience further indentation issues.
Please give a pre-release version of Python extension a try on VS Code insiders.
Thanks aton and let me know if something comes up.
Activity
AlexNaglich commentedon Oct 14, 2024
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 commentedon Oct 14, 2024
Same behaviour and error, only happens with python 3.13, 3.12 works fine.
anthonykim1 commentedon Oct 17, 2024
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.
AlexNaglich commentedon 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 commentedon 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 commentedon 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 commentedon Oct 24, 2024
BTW, just to let Windows users know that this currently does not work in Windows Terminal either, see python/cpython#124119.
masai2018 commentedon Oct 29, 2024
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 commentedon Oct 29, 2024
Thanks Clemens Brunner (@cbrnr) for
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.
36 remaining items
aelb66 commentedon Mar 19, 2025
Having the same indentation error issue
CannotBii commentedon Mar 26, 2025
Hi Karthik Nadig (@karthiknadig) , May i know if this issue was resolved?
karthiknadig commentedon Mar 27, 2025
CannotBii yes. But note that there is a issue on python itself that isn't python/cpython#124096
wjandrea commentedon May 18, 2025
*it's really annoying
«ennuyeux» a deux traductions en anglais qui sont totalement différentes :)
GS-R1 commentedon Jun 9, 2025
I'm having the same indentation issue.
we684123 commentedon Jun 13, 2025
I don't know what happened, but this version now allows Python 3.13 to run in the terminal without showing the 'unexpected indent' error.
版本: 1.101.0 (system setup)
認可: dfaf44141ea9deb3b4096f7cd6d24e00c147a4b1
日期: 2025-06-11T15:00:50.123Z
Electron: 35.5.1
ElectronBuildId: 11727614
Chromium: 134.0.6998.205
Node.js: 22.15.1
V8: 13.4.114.21-electron.0
OS: Windows_NT x64 10.0.26100
marcoaurelioguerrap commentedon Jun 24, 2025
I'm having issues with this error as well. This is how I develop code, It will greatly impact on my performance. I'm using an older python version beause of this
anthonykim1 commentedon Jun 27, 2025
I think its combination of #24401 python/cpython#124119 and python/cpython#133457
Hi folks, I've resolved #25164 which would effectively bring you to the REPL that you are used to using, and you won't need to press extra enter in the terminal to run your command, or experience further indentation issues.
Please give a pre-release version of Python extension a try on VS Code insiders.
Thanks aton and let me know if something comes up.
Also give https://code.visualstudio.com/updates/v1_101#_language-server-based-terminal-suggest a try :)
We've brought the language server completions to REPL in terminal, which would make the REPL experience lot more positive and enjoyable.
Tyler-widd commentedon Jun 27, 2025
Tyler-widd commentedon Jul 20, 2025
It seems it was fixed but now is no longer working again...
marcoaurelioguerrap commentedon Jul 20, 2025
I don't know if this is helpfull or viable but after installing oh-my-posh it is working again.
Tyler-widd commentedon Jul 20, 2025
Anthony Kim (@anthonykim1) does this mean it works on the release version?
Tyler-widd commentedon Jul 24, 2025
Seems like the release version is now breaking as well again
anthonykim1 commentedon Jul 24, 2025
HI folks, sorry for the regression. I've resolved this again here #25296 and this should've been out on the latest point release.
Can people update to latest release (2025.10.1) , or pre-release and see?
Make sure to restart extension and run command "Python Clear Cache and Reload"
Tyler-widd commentedon Jul 28, 2025
I did as you said, hit ctrl+p and found 'Python Clear Cache and Reload'
I still run into issue
