Skip to content

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

Open
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:gh-65339-output-save-txt
Open

gh-65339: Save IDLE Shell and Output windows as text by default#152742
serhiy-storchaka wants to merge 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant