This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Problems using IDLE accelerators with OS X Dvorak - Qwerty ⌘ input method
Type: behavior Stage: resolved
Components: IDLE, macOS Versions: Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: ezio.melotti, hoyeung, kbk, ned.deily, ronaldoussoren
Priority: low Keywords:

Created on 2011-08-14 04:40 by hoyeung, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (9)
msg142046 - (view) Author: hy (hoyeung) Date: 2011-08-14 04:40
The IDLE halts on os x when copy and paste
I tried in 10.6.8 and 10.7
Now I could only use IDLE in Windows in VMware
msg142048 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2011-08-14 04:58
Can you specify what version of Python are you using, how do you copy/paste (e.g. ctrl+c/v, from the menu), and if it halts regardless of what you copy/paste?
msg142051 - (view) Author: hy (hoyeung) Date: 2011-08-14 05:50
I use the latest python 2.7.2 binary in a freshly installed os x
I use command c and command v, and also use the menu.
Also, it halts when I cut.
No matter what I cut, copy and paste, it halts.
It happens both in the shell and editor.

I have to remind myself not to use copy and paste now. Once I forget, IDLE halts and I have to force quit it and I lost everything unsaved.
msg142056 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2011-08-14 07:24
Chances are that you used the python.org 2.7.2 64-bit/32-bit installer but you did not install the latest ActiveState Tcl, currently 8.5.10, as documented here:

    http://www.python.org/download/mac/tcltk/

On OS X 10.6, there should have been a warning message about this in the IDLE shell window. The Apple-supplied Tcl/Tk 8.5 in both Mac OS X 10.6 and 10.7 have known problems as described in the web page above.  Please try with the latest ActiveState Tcl installed and reopen this issue if that does not resolve the problems you see.
msg142057 - (view) Author: hy (hoyeung) Date: 2011-08-14 09:13
Thanks but the problem is not completely solved
I followed your instruction and I can now use mouse to click the menu to copy and paste without problems.
But it still halts when using keyboard to do so.
Is there a complete solution?
msg142062 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2011-08-14 16:24
That is encouraging.  This is almost certainly a problem with Tk.  The Cocoa Tcl/Tk 8.5 used by Apple and ActiveState has been known to have issues with composite characters.  There are a couple of IDLE things to ask about first.  Have you made any Custom Key Bindings for IDLE?  Or added any IDLE extensions?  Both of these would show up in your ~/.idlerc directory.

On to Tk-related questions:  Which OS X keyboard layout are you using?  Are you using any Input Methods?  (Both of these options are shown in System Preferences.)  What keystrokes are used for the menu shortcuts that cause the hang?  And, by hang, you mean that menu item changes color indicating that it is selected but IDLE freezes at that point?

If you have the time and feel comfortable doing so, it would be helpful to know if the same problems are displayed using the older Carbon Tcl/Tk 8.4.  You could temporarily move your current 2.7 installation out of the way by doing this in a Terminal shell:

    cd /Library/Frameworks/Python.framework/Versions
    sudo mv 2.7 2.7-SAVED
    cd /Applications
    sudo mv Python\ 2.7 Python\ 2.7-SAVED

and then downloading and installing the 32-bit-only (10.3+) 2.7.2 installer from python.org.  It is not necessary to install an ActiveState Tcl/Tk 8.4 for this.  Note that if you have migrated to OS X 10.7 already, you probably will not want to stay with this version because it is not easy with Xcode 4 to install third-party Python packages that require building C extension modules.  You can restore your previous Python by:

    cd /Library/Frameworks/Python.framework/Versions
    sudo mv 2.7-SAVED 2.7
    cd /Applications
    sudo mv Python\ 2.7-SAVED Python\ 2.7
msg142087 - (view) Author: hy (hoyeung) Date: 2011-08-14 23:55
Thank you. I kinda know what happens now.

First, I didn't made any change to IDLE after installed.

Second, I'm using dvorak-qwerty. Normally the keyboard layout changes to qwerty when I press Cmd key so that I can type in Dvorak and use the short cut in qwerty. But in IDLE it's not the same case. I find that the halt problem only occur when I copy. So I tried cut and paste. It happens that I can use both Cmd+x and Cmd+b (x in Dvorak layout) to cut and both Cmd+v and Cmd+.(v in Dvorak layout) to paste. So if I press Cmd+c, I'm inputting both Cmd+c and Cmd+j at the same time. And I think that's the reason why it halts. 

By hang, it's exactly what you described.

Also, i tried Tcl/Tk 8.4, the same problem happens.

It's weird since I don't have this problem in Windows when I use a third-party dvorak-qwerty input method.

I temporally changed to Dvorak now to avoid this problem, although there is a little bit inconvenient since all shortcut has changed.
msg142153 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2011-08-16 00:00
Interesting, I didn't know the "Dvorak - Qwerty ⌘" input method existed.  In just some causal experimentation with it, it seems pretty clear that the input method is not being consistently followed by Tk and there seem to be differences between Tk 8.4 and 8.5.  Part of the problem, I think, is that some of the keyboard accelerators are implemented in menus provided by Tk itself and the unrecognized ones are passed on to IDLE.  Unfortunately, Tk does not fully implement Input Method text processing although there does seem to be some work-in-progress in the Tk community to help fix that, see for instance:

http://sourceforge.net/tracker/?func=detail&aid=3205153&group_id=12997&atid=112997

But the work for that issue, if it does get released, may still have no impact on this problem.

If someone is interested in further investigating the issue, I would suggest setting up a small Tcl test case using menu accelerators using Tcl/Tk Wish and, if the problem can be demonstrated there, opening an issue on the Tk tracker.  I'm reasonably certain there is nothing to be done about this in Python itself but I'm not interested in spending more time to prove that.  So I'm going to close this issue as "wont fix".  If anyone has an interest in it, feel free to reopen and reassign.
msg142292 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2011-08-17 21:06
A footnote: I brought this issue up on the Mac Tcl mailing list and it was demonstrated that the problem with mishandling of the menu accelerators with the Dvorak - Qwerty Cmd input method is a general Cocoa Tk problem, and not unique to IDLE or Tkinter.  I've opened a Tk issue for it:

https://sourceforge.net/tracker/?func=detail&aid=3393315&group_id=12997&atid=112997
History
Date User Action Args
2022-04-11 14:57:20adminsetgithub: 56957
2011-08-17 21:06:07ned.deilysetmessages: + msg142292
2011-08-16 00:00:57ned.deilysetstatus: open -> closed
priority: normal -> low
type: behavior

assignee: ned.deily ->
title: IDLE halts on osx when copy and paste -> Problems using IDLE accelerators with OS X Dvorak - Qwerty ⌘ input method
messages: + msg142153
versions: + Python 3.2, Python 3.3
resolution: wont fix
stage: resolved
2011-08-14 23:55:07hoyeungsetmessages: + msg142087
2011-08-14 16:24:37ned.deilysetresolution: wont fix -> (no value)
messages: + msg142062
stage: resolved -> (no value)
2011-08-14 09:13:04hoyeungsetstatus: pending -> open
resolution: works for me -> wont fix
messages: + msg142057
2011-08-14 07:24:01ned.deilysetstatus: open -> pending
messages: + msg142056

assignee: ronaldoussoren -> ned.deily
resolution: works for me
stage: resolved
2011-08-14 05:53:13ezio.melottisetnosy: + kbk, ned.deily
2011-08-14 05:50:56hoyeungsetmessages: + msg142051
2011-08-14 04:58:26ezio.melottisetnosy: + ezio.melotti
messages: + msg142048
2011-08-14 04:40:41hoyeungcreate