gh-158067: Keep Python files first in IDLE Open dialog from Shell - #158071
Conversation
| self.assertEqual(io.filetypes[0][0], 'Text files') | ||
| self.assertEqual(io.save_filetypes[0][0], 'Text files') | ||
|
|
||
| def test_open_defaults_to_python(self): |
There was a problem hiding this comment.
This does not really test what we want to know, which is what the user sees when the select the menu item or give the shortcut key. The same is true of the test above. Both would require generating the event and mocking the dialog call. Possible, but I tested this in live IDLE and want to fix the regression now, before the next releases in a week. And I have other pr to review for inclusion. So I will merge as is.
|
Thanks @lazerg for the PR, and @terryjreedy for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
|
Thanks @lazerg for the PR, and @terryjreedy for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
|
Thanks @lazerg for the PR, and @terryjreedy for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15. |
|
GH-158141 is a backport of this pull request to the 3.13 branch. |
|
GH-158142 is a backport of this pull request to the 3.14 branch. |
|
GH-158143 is a backport of this pull request to the 3.15 branch. |
gh-65339 made Shell and Output windows save as text by setting
io.filetypesto the text-first list, butaskopenfilereads the same attribute. Since Shell is usually the first window, File > Open started with "Text files (*.txt)" selected and hid .py files.The save dialog now reads a separate
save_filetypesattribute, which Output windows override, so File > Open keeps listing Python files first.Fixes #158067
Text files (*.txt)#158067