Skip to content

Regression in 9.0.1 from 8.33.0 - No longer dedents inputs. #14818

@Erotemic

Description

@Erotemic

Running ipython in the terminal if I copy and paste this block of code:

    # Comment
    x = 1

with the leading indentation on both lines, in 8.33.0 it works fine. IPython recognizes the code has consistent leading whitespace, presumably dedents it under the hood, and executes it.

In [1]:     # Comment
   ...:     x = 1

In [2]: 

However, in 9.0.1

In [1]:     # Comment
   ...:     x = 1
   ...: 
  Cell In[1], line 2
    x = 1
    ^
IndentationError: unexpected indent

I'm not sure if this was intentional or not, but this is a major usability issue for me. My entire workflow is based around copy/pasting chunks of code. I've been working this way for 15 years. I've written libraries around it. There is a PR awaiting merge in CPython to add this dedent feature to "python -c".

If this is intentional, I beg the maintainers to reconsider. Otherwise, this is a major bug.

Tested on Ubuntu 24.04 on CPython 3.13.2 and 3.11.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions