gh-59568: Fix IDLE file dialogs for names starting with a tilde - #157624
Merged
terryjreedy merged 1 commit intoSep 24, 2026
Merged
Conversation
Tcl before version 9 substitutes a leading tilde in the initial file name, so "Save As" crashed IDLE on Windows and did not work on X11 for such files.
terryjreedy
approved these changes
Sep 24, 2026
Member
There was a problem hiding this comment.
On 3.13, I got 'no response' on one of insert or delete ~, but no crash, so I will soften claim.
Will not when start from console. ADDED: I think somewhat vague is good enough here for people who have
experienced the problem. I am not convinced that we have covered every possible ~ problem,
but fixing the reported one is good enough.
|
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. |
|
GH-158054 is a backport of this pull request to the 3.15 branch. |
|
GH-158055 is a backport of this pull request to the 3.14 branch. |
|
GH-158056 is a backport of this pull request to the 3.13 branch. |
terryjreedy
pushed a commit
that referenced
this pull request
Sep 24, 2026
GH-157624) (#158056) gh-59568: Fix IDLE file dialogs for names starting with a tilde (GH-157624) Tcl before version 9, not on macOS Aqua systems, substitutes a leading tilde in a file name. "Save As" can fail on Windows and X11 and may crash IDLE on Windows. (cherry picked from commit fc9df96) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
terryjreedy
pushed a commit
that referenced
this pull request
Sep 24, 2026
GH-157624) (#158055) gh-59568: Fix IDLE file dialogs for names starting with a tilde (GH-157624) Tcl before version 9, not on macOS Aqua systems, substitutes a leading tilde in a file name. "Save As" can fail on Windows and X11 and may crash IDLE on Windows. (cherry picked from commit fc9df96) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
hugovk
pushed a commit
that referenced
this pull request
Sep 28, 2026
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
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.
Tcl before version 9 does implicit tilde substitution on file names. IDLE passes the basename of the current file as
-initialfileto the file dialogs, so for a file like~template.pythe native Windows dialog raisedTclError: user "template.py" doesn't existand IDLE exited, and on X11 the Save button did nothing until the file existed. The macOS dialog does not interpret the name and is not affected.Escape a leading tilde with
./(.\on Windows) indefaultfilename(), as suggested in the issue, on Tcl older than 9 and non-Aqua only. Tcl 9 does not do implicit tilde substitution any more, so nothing changes there. Verified on X11 (Tk 8.6.17) and Windows (Tk 8.6.15).🤖 Generated with Claude Code