Hi, Leopard ships with libedit, which is almost the same as readline, but has another way to configure completion keys. To enable tab completion you have to use rl.parse_and_bind("bind ^I complete") instead of rl.parse_and_bind("bind ^I rl_complete") instead of rl.parse_and_bind("tab: complete"). The guys from IPython patched around it, see http://ipython.scipy.org/moin/InstallationOSXLeopard/LeopardPythonReadli ne, but is seems to me this is better solved in the python readline module itself.
I don't really agree. Libedit's configuration is different from that of GN U readline. It might be useful to document this issue in the documentation of the readline module (and of rlcompleter). Another alternative would be to add code to the readline module that emulates the GNU syntax when compeling using libedit, but I don't think that's worth the effort. I would be willing to review such a patch though.
Documenting this would be great, since it caught me by surprise and took a while to figure out. To get the Cmd module to work, atm you have to override the call to parse_and_bind, setting self.completekey isn't enough, so that one is broken on Leopard. Patching the readline module is indeed a lot of work, you need to convert readline names like 'Tab' to integers to pass them to libedit, and convert the syntax as well. It would be better if libedit would just accept readline syntax, but that's outside the scope of Python.
I intend to close this as won't fix. The issue is caused by Apple's build of Python, the generic Python.org build won't even compile when using libedit.
As mentioned before I'm closing this as "won't fix" because this is an issue with Apple's copy of Python, not the one shipped by us (the generic Python tree doesn't even compile correctly when using libedit)
History
Date
User
Action
Args
2022-04-11 14:56:33
admin
set
github: 46989
2009-09-06 13:21:17
ronaldoussoren
set
status: open -> closedresolution: wont fixmessages: +