Skip to content

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix the logic of Ctrl+D (^ D) behavior in the mod: _pyrepl module…
… to ensure correct termination of input under specific conditions.

Co-authored-by: adam j hartz <adam@smatz.net>
  • Loading branch information
deepwzh and adqm committed Jul 20, 2025
commit cfd5a68b83d12e61a1f3d277b4fd7681dddd09a9
2 changes: 1 addition & 1 deletion Lib/_pyrepl/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ def do(self) -> None:
r.update_screen()
r.console.finish()
raise EOFError
elif "\n" in b and self.event[-1] == "\004":
elif b and b[-1].endswith('\n') and self.event[-1] == "\004":
self.finish = True

for i in range(r.get_arg()):
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy