FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-136061: IDLE - modernize idlelib code in editor.Editor.load_extension methodname processing by johnzhou721 · Pull Request #134874 · python/cpython · GitHub

Repository navigation

gh-136061: IDLE - modernize idlelib code in editor.Editor.load_extension methodname processing - #134874

Merged
zware merged 39 commits into
python:mainfrom
johnzhou721:idledos
Sep 3, 2026
Merged

zware merged 39 commits into
python:mainfrom
johnzhou721:idledos

Conversation

johnzhou721 commented May 29, 2025 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Contributor

A DOS by Quadratic complexity issue is fixed in idlelib. Part of (but does not fix) #134873.

terryjreedy moved this to In Progress in IDLE Issues May 29, 2025
terryjreedy self-assigned this May 29, 2025

Copy link
Copy Markdown
Member

I believe that the 6 lines from 1205 to 1210 can be replaced by 2 lines -- an re.match and an f-string. I will submit an alternate proposal later. I believe that the input vevent name should have either no <>s or 2 of each, with maybe the latter for back compatibility (I will test). But I will may stick with the more general code to not break buggy extensions.

ZeroIntensity left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Assuming this is the fix that we go with, let's add a test case.

ZeroIntensity added type-security A security issue needs backport to 3.9 needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes needs backport to 3.13 only security fixes needs backport to 3.14 bugs and security fixes labels May 29, 2025

johnzhou721 commented May 29, 2025 via email

Copy link
Copy Markdown
Contributor Author

Comment thread Lib/idlelib/editor.py

johnzhou721 commented May 29, 2025 via email

Copy link
Copy Markdown
Contributor Author

kexinoh commented May 30, 2025

Copy link
Copy Markdown

@johnzhou721
I would greatly appreciate it if you could kindly address the issue located at

cpython/Lib/idlelib/editor.py

Lines 1373 to 1378 in 5ab66a8

while True:
chars = chars[:-1]
ncharsdeleted = ncharsdeleted + 1
have = len(chars.expandtabs(tabwidth))
if have <= want or chars[-1] not in " \t":
break
. I sincerely apologize for overlooking this in my previous message.

As an example, I successfully utilized Gemini 2.5 Pro to generate a reasonable fix for this problem. Could you give it a try?

Copy link
Copy Markdown
Contributor Author

@kexinoh Yes, I would give it a try once I have time; however, I am working on something else right now -- is it acceptable if I delay this by about a day or so?

(if anyone else has a fix ready before I get to this, feel free to make a pr onto the branch of my pr and I'll merge it into my PR)

…dziqkQ.rst

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>

Copy link
Copy Markdown
Contributor Author

@kexinoh I have a small amount of time not enough to work on anything else before I end my day so I attempted the issue you pointed out -- but can't test though.

Copy link
Copy Markdown
Contributor Author

Assuming this is the fix that we go with, let's add a test case.

Where? How? For what? Thanks! @ZeroIntensity

Copy link
Copy Markdown
Member

Where? How? For what?

We need a test case in test_idlelib that results in DOS/extreme slowness off main. Basically, just do something to prove that this PR fixes it (probably just testing with large amounts of data).

Comment thread Lib/idlelib/editor.py
Comment thread Lib/idlelib/News3.txt

merwok commented Nov 4, 2025

Copy link
Copy Markdown
Member

Can the PR title be changed to be more useful? Every PR is a change. Good titles say «Add thing to spam» or «Fix eggs with ham»

johnzhou721 changed the title gh-136061: IDLE - update code in editor.Editor.load_extension gh-136061: IDLE - modernize idlelib code in editor.Editor.load_extension methodname processing Nov 4, 2025

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

github-actions Bot added the stale Stale PR or inactive for long period of time. label Apr 25, 2026
serhiy-storchaka added the needs backport to 3.15 bugs and security fixes label May 30, 2026
github-actions Bot removed the stale Stale PR or inactive for long period of time. label May 31, 2026

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

This PR is stale because it has been open for 90 days with no activity.

github-actions Bot added the stale Stale PR or inactive for long period of time. label Sep 3, 2026
zware enabled auto-merge (squash) September 3, 2026 20:43
zware merged commit 0625799 into python:main Sep 3, 2026
51 of 52 checks passed
github-project-automation Bot moved this from In Progress to Done in IDLE Issues Sep 3, 2026

Copy link
Copy Markdown

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

bedevere-app Bot commented Sep 3, 2026

Copy link
Copy Markdown

GH-156911 is a backport of this pull request to the 3.15 branch.

bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Sep 3, 2026

bedevere-app Bot commented Sep 3, 2026

Copy link
Copy Markdown

GH-156912 is a backport of this pull request to the 3.14 branch.

bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Sep 3, 2026

bedevere-app Bot commented Sep 3, 2026

Copy link
Copy Markdown

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

bedevere-app Bot removed the needs backport to 3.13 only security fixes label Sep 3, 2026
clin1234 pushed a commit to clin1234/cpython that referenced this pull request Sep 12, 2026
terryjreedy pushed a commit that referenced this pull request Oct 9, 2026
… methodname processing (GH-134874) (#156911)

gh-136061: Simplify idlelib.editor.EditorWindow.load_extension methodname processing (GH-134874)
(cherry picked from commit 0625799)

Co-authored-by: John <johnzhou721@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news stale Stale PR or inactive for long period of time.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

9 participants


Back | FazBrowse Home | New Git URL