Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-133400: Fixed Ctrl+D (^D) behavior in :mod:_pyrepl module#133883

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
deepwzh wants to merge1 commit intopython:main
base:main
Choose a base branch
Loading
fromdeepwzh:fix-issue-133400

Conversation

deepwzh
Copy link

@deepwzhdeepwzh commentedMay 11, 2025
edited by bedevere-appbot
Loading

Fixed Ctrl+D (^D) behavior in :mod:_pyrepl module:

  • Now properly exits multiline mode when pressed in multiline section
  • Added test cases to verify the behavior in both multiline and single line modes

@StanFromIreland
Copy link
Contributor

StanFromIreland commentedMay 11, 2025
edited
Loading

This is not ideal:

>>>ifTrue:...File"<python-input-2>",line1ifTrue:^IndentationError:expectedanindentedblockafter'if'statementonline1>>>

@deepwzh
Copy link
Author

This is not ideal:

>>>ifTrue:...File"<python-input-2>",line1ifTrue:^IndentationError:expectedanindentedblockafter'if'statementonline1>>>

This fix is ​​to correctly handle the issue of Ctrl+D to exit multi-line mode. What do you think the expected behavior should be?
@StanFromIreland

@ZeroIntensityZeroIntensity added topic-replRelated to the interactive shell needs backport to 3.13bugs and security fixes needs backport to 3.14bugs and security fixes labelsMay 11, 2025
@feoh
Copy link
Contributor

feoh commentedMay 19, 2025
edited
Loading

@ambv FWIW I tested this PR on my Mac (main branch, latest, MacOS latest) and it works great. I tried throwing a bunch of other unclosed constructs (e.g. {, [, etc.) and none exhibited this error either.

@feoh
Copy link
Contributor

@StanFromIreland Are you suggesting that the error message in the if True: case could be more clear?

The fact that the user isn't supplying a valid indented block after the if True: is indeed a problem the language needs to flag, so I'm curious what specific wording you think might be more clear. Also it seems to me like this could be a separate Github issue. Do you agree?

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@pablogsalpablogsalAwaiting requested review from pablogsalpablogsal is a code owner

@lysnikolaoulysnikolaouAwaiting requested review from lysnikolaoulysnikolaou is a code owner

@ambvambvAwaiting requested review from ambvambv is a code owner

Assignees
No one assigned
Labels
awaiting reviewneeds backport to 3.13bugs and security fixesneeds backport to 3.14bugs and security fixestopic-replRelated to the interactive shell
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@deepwzh@StanFromIreland@feoh@ZeroIntensity

[8]ページ先頭

©2009-2025 Movatter.jp