GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-118911: Trailing whitespace in a block shouldn't prevent the user from terminating the code block by aelsayed95 · Pull Request #119355 · python/cpython

Conversation

@aelsayed95

@aelsayed95 aelsayed95 commented May 21, 2024 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Issue described in #118911

Fix includes:

  1. If the user hits enter twice, they are able to exit out of the block, even if there's trailing whitespace.
  2. Trim trailing whitespace in the HistoricalReader to match IPython's behavior
  • Issue: Editing the last line in a block in the new REPL is buggy #118911

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@aelsayed95
pythongh-118911: Trailing whitespace in a block shouldnt prevent the …
77ca92a
…user from terminating the code block
@ghost

ghost commented May 21, 2024 •
edited by ghost
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.
CLA signed

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app

bedevere-app Bot commented May 21, 2024

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot added the awaiting review label May 21, 2024
@bedevere-app bedevere-app Bot mentioned this pull request May 21, 2024
Editing the last line in a block in the new REPL is buggy #118911
Closed
@lysnikolaou lysnikolaou added the topic-repl Related to the interactive shell label May 21, 2024
@blurb-it
📜🤖 Added by blurb_it.
edbf327
@aelsayed95

aelsayed95 commented May 21, 2024

Copy link
Copy Markdown
Contributor Author

One issue discovered while testing this (exists on main too):

Within a code block, if the user hits enter twice to add new lines, the first line matches the previous line's indentation while the next one doesn't.
This doesn't match IPython's behaviour.

ambv reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aelsayed95

aelsayed95 commented May 21, 2024

Copy link
Copy Markdown
Contributor Author

Added #119356

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lysnikolaou lysnikolaou added the needs backport to 3.13 only security fixes label May 21, 2024
aelsayed95 added 4 commits May 21, 2024 21:28
@aelsayed95
for clarity
4996c5e
@aelsayed95
Merge branch 'fix_issue_118911' of github.com:aelsayed95/cpython into…
6ee25da
… fix_issue_118911
@aelsayed95
lint
6c0682b
@aelsayed95
reword NEWS.d
4e62b96
savannahostrowski
savannahostrowski reviewed May 21, 2024
View reviewed changes

@savannahostrowski savannahostrowski left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I tested this on Fedora (via Devcontainer) and it looks like this now works as described.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Misc/NEWS.d/next/Library/2024-05-21-20-13-23.gh-issue-118911.iG8nMq.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/_pyrepl/readline.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

ambv added 2 commits May 22, 2024 07:24
@ambv
Merge branch 'main' into pythongh-119355
71d1bcb
@ambv
Fix ReST syntax in blurb, reword a bit
27ad76c
ambv
ambv approved these changes May 22, 2024
View reviewed changes

@ambv ambv left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good.

I merged new changes in main into your PR since there were conflicts, and reworded the blurb per my suggestion.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels May 22, 2024
@ambv
ambv merged commit 5091c44 into python:main May 22, 2024
@bedevere-app bedevere-app Bot removed the awaiting merge label May 22, 2024
@miss-islington-app

miss-islington-app Bot commented May 22, 2024

Copy link
Copy Markdown

Thanks @aelsayed95 for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington-app

miss-islington-app Bot commented May 22, 2024

Copy link
Copy Markdown

Sorry, @aelsayed95 and @ambv, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 5091c4400c9ea2a2d1e4d89a28c9d0de2651fa6d 3.13
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington-app miss-islington-app Bot assigned ambv May 22, 2024
@ambv

ambv commented May 22, 2024

Copy link
Copy Markdown
Contributor

Thanks, Aya! ✨ 🍰 ✨

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ambv

ambv commented May 22, 2024

Copy link
Copy Markdown
Contributor

The backport depends on GH-119362. I'll deal with that tomorrow.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lysnikolaou

lysnikolaou commented May 22, 2024

Copy link
Copy Markdown
Member

Thanks, @aelsayed95! I've merged #119362. I'll open a backport PR now.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

lysnikolaou pushed a commit to lysnikolaou/cpython that referenced this pull request May 22, 2024
@aelsayed95 @ambv @lysnikolaou
[3.13] pythongh-118911: Trailing whitespace in a block shouldn't prev…
13c31f1
…ent the user from terminating the code block (pythonGH-119355)

(cherry picked from commit 5091c44)

Co-authored-by: Aya Elsayed <[email protected]>
Co-authored-by: Łukasz Langa <[email protected]>
@bedevere-app

bedevere-app Bot commented May 22, 2024

Copy link
Copy Markdown

GH-119404 is a backport of this pull request to the 3.13 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 only security fixes label May 22, 2024
lysnikolaou added a commit that referenced this pull request May 23, 2024
@lysnikolaou @aelsayed95 @ambv
[3.13] gh-118911: Trailing whitespace in a block shouldn't prevent th…
9fa1b4f
…e user from terminating the code block (GH-119355) (#119404)

(cherry picked from commit 5091c44)

Co-authored-by: Aya Elsayed <[email protected]>
Co-authored-by: Łukasz Langa <[email protected]>
@JelleZijlstra JelleZijlstra mentioned this pull request May 28, 2024
backport a9a74da 3.13 #119642
Closed
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
@aelsayed95 @ambv @estyxx
pythongh-118911: Trailing whitespace in a block shouldn't prevent the…
0d1ccbb
… user from terminating the code block (python#119355)

Co-authored-by: Łukasz Langa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@savannahostrowski savannahostrowski savannahostrowski left review comments
@ambv ambv ambv approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@ambv ambv

Labels

topic-repl Related to the interactive shell

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@aelsayed95 @ambv @lysnikolaou @savannahostrowski
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.