Skip to content

gh-60402: Fix Tab in a string in IDLE - #157593

Merged
terryjreedy merged 1 commit into
python:mainfrom
serhiy-storchaka:gh-60402-tab-in-string
Sep 16, 2026
Merged

terryjreedy merged 1 commit into
python:mainfrom
serhiy-storchaka:gh-60402-tab-in-string

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Sep 15, 2026

Copy link
Copy Markdown
Member

Tab after text in a string, as in a docstring, opened the file name completion list with unrelated names. Open it only if some file name starts with the text before the cursor; otherwise insert a tab. Control-Space still opens the list.

🤖 Generated with Claude Code

Open the file name completion list only if some file name starts
with the text before the cursor; otherwise insert a tab.

Co-authored-by: Roger Serwy <roger.serwy@gmail.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

@terryjreedy terryjreedy 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.

Manual testing with tab in string: no match, no box. If one wants a box, force it.
Box is such a nuisance I am willing to call this a bug fix with no discussion needed.

An unwanted match is still a nuisance, whether one gets completion or box.
One must type a fake no-match entry, tab, and correct the entry, or enter '\t',
or do entry in an empty directory. Fortunately, this should be rare in IDLE use.

Alternative is to disable filename completion with tab, which would need discussion, and which would likely be rejected as more needed than literal tab insertion in situations where IDLE is used.

@terryjreedy
terryjreedy merged commit 699e802 into python:main Sep 16, 2026
55 checks passed
@miss-islington-app

Copy link
Copy Markdown

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

@bedevere-app

bedevere-app Bot commented Sep 16, 2026

Copy link
Copy Markdown

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

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Sep 16, 2026
@bedevere-app

bedevere-app Bot commented Sep 16, 2026

Copy link
Copy Markdown

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

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

bedevere-app Bot commented Sep 16, 2026

Copy link
Copy Markdown

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

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Sep 16, 2026
terryjreedy pushed a commit that referenced this pull request Sep 16, 2026
gh-60402: Fix Tab in a string in IDLE (GH-157593)

Open the file name completion list only if some file name starts
with the text before the cursor; otherwise insert a tab.

If one wants the completion list, use Edit => Show completions.
(cherry picked from commit 699e802)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Roger Serwy <roger.serwy@gmail.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
terryjreedy pushed a commit that referenced this pull request Sep 16, 2026
gh-60402: Fix Tab in a string in IDLE (GH-157593)

Open the file name completion list only if some file name starts
with the text before the cursor; otherwise insert a tab.

If one wants the completion list, use Edit => Show completions.
(cherry picked from commit 699e802)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Roger Serwy <roger.serwy@gmail.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
@serhiy-storchaka
serhiy-storchaka deleted the gh-60402-tab-in-string branch September 16, 2026 16:48
@bedevere-bot

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot ARM64 Windows Non-Debug 3.13 (tier-2) has failed when building commit e396482.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/2006/builds/361) and take a look at the build logs.
  4. Check if the failure is related to this commit (e396482) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/2006/builds/361

Failed tests:

  • test_int

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "C:\Users\buildworker\buildarea\3.13.ware-win11-arm64.nondebug\build\Lib\test\test_int.py", line 740, in test_denial_of_service_prevented_str_to_int
    self.assertLessEqual(sw_fail_extra_huge.seconds, sw_convert.seconds/2)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 0.015625 not less than or equal to 0.0078125

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants