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

Appearance settings

gh-131430: Fix crashes on an empty DELETE_WORD_BACKWARDS (^W) followed by CLEAR_TO_START (^K) #131452

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
Loading
from

Conversation

deepwzh
Copy link

@deepwzh deepwzh commented Mar 19, 2025

Add the handling of kill_range null detection, which is a left closed and right open interval. When end start<=1, it means that no operation has been done and should be skipped; The original writing only handled the case of end==start.

@bedevere-app
Copy link

bedevere-app bot commented Mar 19, 2025

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.

@bedevere-app
Copy link

bedevere-app bot commented Mar 19, 2025

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.

Copy link
Member

@tomasr8 tomasr8 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @deepwzh! This will need a news entry and ideally a test to make sure we don't regress. Feel free to have a look at our devguide or just ask me if you need help!

@@ -58,7 +58,7 @@ def do(self) -> None:

class KillCommand(Command):
def kill_range(self, start: int, end: int) -> None:
if start == end:
if end - start <= 1:
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this is correct, consider for example this input:

>>> 12

where the cursor is over 2. If you press ^w, this no longer removes the 1 .

Perhaps checking that kill_ring is not an empty list would be a good alternative?

- if is_kill(r.last_command):
+ if is_kill(r.last_command) and r.kill_ring:

@deepwzh
Copy link
Author

deepwzh commented Apr 30, 2025

Thanks for the PR @deepwzh! This will need a news entry and ideally a test to make sure we don't regress. Feel free to have a look at our devguide or just ask me if you need help!

Thank you for your guidance. I will try to submit a revised version again~~

I have something to ask first. I noticed that after submitting my PR for a considerable period of time, the automatically assigned reviewers do not seem to have enough time to review. In this situation, do I usually need to be patient and wait, or can I look for other reviewers?

@tomasr8
Copy link
Member

tomasr8 commented Apr 30, 2025

We are nearing the beta freeze for Python 3.14 so everybody is even busier than usual and there can be larger delays in getting reviews.. That said, I'm happy to help you review the PR, feel free to ping me once you have addressed my comment 🙂

@deepwzh deepwzh force-pushed the fix-issue-131430 branch 2 times, most recently from 413c3f9 to ac7bbfc Compare May 11, 2025 06:57
@deepwzh
Copy link
Author

deepwzh commented May 11, 2025

We are nearing the beta freeze for Python 3.14 so everybody is even busier than usual and there can be larger delays in getting reviews.. That said, I'm happy to help you review the PR, feel free to ping me once you have addressed my comment 🙂

Got it! Thanks for your contributions to Python!

@tomasr8 Today I completed the revisions as per your instructions and added some additional tests. Could you please review them when you have time?

@deepwzh deepwzh requested a review from tomasr8 May 11, 2025 09:51
Lib/test/test_pyrepl/test_reader.py Outdated Show resolved Hide resolved
Lib/test/test_pyrepl/test_reader.py Outdated Show resolved Hide resolved
Lib/test/test_pyrepl/test_reader.py Outdated Show resolved Hide resolved
Lib/test/test_pyrepl/test_reader.py Outdated Show resolved Hide resolved
@deepwzh deepwzh force-pushed the fix-issue-131430 branch from efbeeab to f95e9c3 Compare May 12, 2025 06:13
@deepwzh deepwzh requested a review from tomasr8 May 12, 2025 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.