Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

GH-88564: IDLE - fix 2 Edit menu hotkey displays#99743

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
terryjreedy wants to merge1 commit intopython:main
base:main
Choose a base branch
Loading
fromterryjreedy:mackey

Conversation

terryjreedy
Copy link
Member

@terryjreedyterryjreedy commentedNov 24, 2022
edited by bedevere-bot
Loading

On Mac Cocoa, ^+backspace and ^+space were mis-displayed as ^B and ^S. Replace 'backslash' with '' everywhere, just as 'slash', for example, is replaced with '/'. On Mac Cocoa, change 'space' to 'Space', which then displays as 'Space' instead of 'S'. ('Space' is also used for the Mac-specific Emoji & Symbols entry.)

Co-authored byronaldoussoren

On Mac Cocoa, ^+backspace and ^+space were misdisplayedas ^B and ^S. Replace 'backslash' with '\' everywhere,just as 'slash', for example, is replaced with '/'.On Mac Cocoa, change'space' to 'Space', which then displaysas 'Space' instead of 'S'.  ('Space' is also used for theMac-specific Emoji & Symbols entry.)
@terryjreedy
Copy link
MemberAuthor

@ronaldoussoren Besides Windows, I tested this on Catalina by editing installed editor.py. Is the space-> Space fix only needed for Cocoa?

@terryjreedy
Copy link
MemberAuthor

The test failure is hanging for 20 minutes in
test_case_soft_keyword (idlelib.idle_test.test_colorizer.ColorDelegatorTest.test_case_soft_keyword) .
I testedpython3.x -m test.test_idle -v on my MacBook Air and got the same failure even with the 2 new lines commented out and with 3.11 and 3.10. I am baffled.
@ned-deily You have any ideas either?

@ronaldoussoren
Copy link
Contributor

This PR does not work for me. If I manually apply the patch to an installed copy of Python 3.12 IDLE crashes when I try to open the Edit menu ("segmentation fault"). Reverting the patch fixes the crash.

The crash report has a stack trace somewhere deep inside system frameworks with Tk on the call stack.

The fix is likely only needed for Cocoa, otherwise we'd have reports from other platforms as well. But that's not something I can test, I can only test using the copy of Tk shipped with out installers.

@hugovkhugovk removed the needs backport to 3.10only security fixes labelApr 7, 2023
@terryjreedy
Copy link
MemberAuthor

PR not working right yet.

Copy link
Contributor

@ronaldoussorenronaldoussoren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I've tested this PR with a slight modification to make it work on top of#113513:

diff --git a/Lib/idlelib/editor.py b/Lib/idlelib/editor.pyindex 8bf517d41f..36fde4af73 100644--- a/Lib/idlelib/editor.py+++ b/Lib/idlelib/editor.py@@ -1678,6 +1678,7 @@ def prepstr(s):  'bracketleft': '[',  'bracketright': ']',  'slash': '/',+ 'backslash': '\\', }  def get_accelerator(keydefs, eventname):diff --git a/Lib/idlelib/macosx.py b/Lib/idlelib/macosx.pyindex 8637e8ebf2..60c58d59a3 100644--- a/Lib/idlelib/macosx.py+++ b/Lib/idlelib/macosx.py@@ -263,6 +263,8 @@ def setupApp(root, flist):     global _idle_root     _idle_root = root     if isAquaTk():+        from idlelib import editor+        editor.keynames["space"] = "Space"         hideTkConsole(root)         overrideRootMenu(root, flist)         addOpenEventSupport(root, flist)

That PR makes it an error to callisAquaTk beforemacosx.setupApp is called to avoid problems with Tk Aqua (see that PR for background).

The menu now looks correct, and I've tested that the shortcuts work as well:

image

My change to the diff should work both with and without#113513. Please move settingidlelib.editor.keynames['space'] tomacosx.setupApp as in the diff above to avoid creating merge conflict when that PR is merged.

@bedevere-app
Copy link

When you're done making the requested changes, leave the comment:I have made the requested changes; please review again.

@ronaldoussorenronaldoussoren added the needs backport to 3.12only security fixes labelDec 31, 2023
@serhiy-storchakaserhiy-storchaka added needs backport to 3.13bugs and security fixes and removed needs backport to 3.11only security fixes labelsMay 9, 2024
@tomasr8tomasr8 removed the needs backport to 3.12only security fixes labelApr 10, 2025
@serhiy-storchakaserhiy-storchaka added the needs backport to 3.14bugs and security fixes labelMay 8, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ronaldoussorenronaldoussorenronaldoussoren requested changes

Assignees

@terryjreedyterryjreedy

Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

6 participants
@terryjreedy@ronaldoussoren@hugovk@serhiy-storchaka@tomasr8@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp