IDLE has the contextual menu right-click bug on mac (Tk problem)
There is already a patch issued for this problem: 开发者_运维百科issue 10404 I've downloaded the patch (issue10404-idle_no_context_menus.txt) - where and how do I install it? Thanks in advance.Find the EditorWindow.py
file in your filesystem (find / -name EditorWindow.py
if you're completely in the dark about where it might live); cd
into it's containing directory, then run:
patch --dry-run < ~/path/to/issue10401-idle_no_context_menus.txt
If it succeeds, take off the --dry-run
and re-run the command. If it didn't succeed, try adding -P2
, -P3
or -P1
. (The -P<n>
says to ignore the <n>
directories named in the patch, and I can never remember exactly how it works, so I just fiddle with --dry-run
and the options until it works. :)
If the patch doesn't cleanly apply because your version doesn't match the 'pre' version in the patch file exactly, you can just edit the file and "apply the diff by hand" -- make the same kinds of changes it does, but accounting for whatever might have changed. Sometimes it is just an indentation level that changed, so it could be easy, sometimes the entire logic is different, and it is pointless to try to make the patch fit.
This patches are diffs against the source code. In this case its a Python file, so you find the Python file in question (Lib/idlelib/EditorWindow.py) and use the patch
command to patch it.
In general these kinds of patches are to be used on development checkouts of the Python source code, and they may require you to check out the Python source and compile it from the svn. It depends on how much the code has changed between the version you have installed and the trunk version on which the patch usually is based.
精彩评论