Skip to content

gh-65339: Save IDLE Shell and Output windows as text by default#152742

Merged
terryjreedy merged 1 commit into
python:mainfrom
serhiy-storchaka:gh-65339-output-save-txt
Jul 1, 2026
Merged

gh-65339: Save IDLE Shell and Output windows as text by default#152742
terryjreedy merged 1 commit into
python:mainfrom
serhiy-storchaka:gh-65339-output-save-txt

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Jul 1, 2026

Copy link
Copy Markdown
Member

The Shell and Output windows contain shell logs and Find in Files (grep) output, not Python source, so defaulting their Save As dialog to .py is misleading — beginners have saved a Shell session as .py and then hit a SyntaxError running it (see the issue).

IOBinding gains text_filetypes (text files listed first) and text_defaultextension = '.txt'. OutputWindow.__init__ switches its io to these, and the Shell (PyShell(OutputWindow)) inherits it.

.py is still selectable, just no longer the default. Terry also considered removing .py as an option entirely for these windows; that stricter change is left out here.

The added test checks that an Output window's save defaults to text.

🤖 Generated with Claude Code

Their content is not Python source, so the Save As dialog now lists text
files first and defaults to a ".txt" extension.
@serhiy-storchaka serhiy-storchaka added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Jul 1, 2026
@terryjreedy terryjreedy merged commit efcfb1a into python:main Jul 1, 2026
59 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 Jul 1, 2026

Copy link
Copy Markdown

GH-152821 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 Jul 1, 2026
@bedevere-app

bedevere-app Bot commented Jul 1, 2026

Copy link
Copy Markdown

GH-152822 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 Jul 1, 2026
@bedevere-app

bedevere-app Bot commented Jul 1, 2026

Copy link
Copy Markdown

GH-152823 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 Jul 1, 2026
terryjreedy pushed a commit that referenced this pull request Jul 1, 2026
GH-152742) (#152823)

gh-65339: Save IDLE Shell and Output windows as text by default (GH-152742)

Their content is not Python source, so the Save As dialog now lists text
files first and defaults to a ".txt" extension.
(cherry picked from commit efcfb1a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
terryjreedy pushed a commit that referenced this pull request Jul 1, 2026
GH-152742) (#152821)

gh-65339: Save IDLE Shell and Output windows as text by default (GH-152742)

Their content is not Python source, so the Save As dialog now lists text
files first and defaults to a ".txt" extension.
(cherry picked from commit efcfb1a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
terryjreedy pushed a commit that referenced this pull request Jul 1, 2026
GH-152742) (#152822)

gh-65339: Save IDLE Shell and Output windows as text by default (GH-152742)

Their content is not Python source, so the Save As dialog now lists text
files first and defaults to a ".txt" extension.
(cherry picked from commit efcfb1a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@serhiy-storchaka serhiy-storchaka deleted the gh-65339-output-save-txt branch July 2, 2026 04:39
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.

2 participants