#6695 closed enhancement (wontfix)
trac-admin should alter completion binding on Mac OS X Leopard
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | admin/console | Version: | 0.11b1 |
Severity: | normal | Keywords: | readline, libedit, macosx, patch |
Cc: | Thijs Triemstra | Branch: | |
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
Python-2.5.1 on Mac OS X Leopard does not use the standard readline library, but libedit. In ipython the following solution is used:
# Test to see if libedit is being used instead of GNU readline. # Thanks to Boyd Waters for this patch. import readline as _rl uses_libedit = False if sys.platform == 'darwin' and have_readline: import commands (status, result) = commands.getstatusoutput( "otool -L %s | grep libedit" % _rl.__file__ ) if status == 0 and len(result) > 0: # we are bound to libedit - new in Leopard _rl.parse_and_bind("bind ^I rl_complete") print "Leopard libedit detected." uses_libedit = True
Attachments (2)
Change History (12)
comment:1 by , 17 years ago
Keywords: | macosx added; mac os x removed |
---|
comment:2 by , 17 years ago
Hello,
I attach a patch against source:sandbox/multirepos as svn-diff. As console.py has not changed this should be appliable against the trunk as well.
Regards Mirko
by , 17 years ago
Attachment: | libedit.patch added |
---|
comment:3 by , 17 years ago
HG-Repo with the patch: http://friedenhagen.net:8000/trac/sandbox/multirepos/rev/d0d03c4b66cc
follow-up: 5 comment:4 by , 17 years ago
Isn't that rather a bug from the readline package on that platform? You'd certainly prefer a fix that will work for each of your shell-like applications, rather than having to patch each one. Have you tried doing that in your PYTHONSTARTUP file, like described in this blog entry?
On a somewhat related note, thanks to the links you've posted, I found out that IPython's PyReadline works quite well with TracAdmin on Windows (no history support, though).
comment:5 by , 17 years ago
Replying to cboos:
Isn't that rather a bug from the readline package on that platform? You'd certainly prefer a fix that will work for each of your shell-like applications, rather than having to patch each one. Have you tried doing that in your PYTHONSTARTUP file, like described in this blog entry?
OK, then I propose to use a fix suggested in http://docs.python.org/tut/node4.html#SECTION004240000000000000000, see attachment:pythonstartup.patch
by , 17 years ago
Attachment: | pythonstartup.patch added |
---|
comment:6 by , 16 years ago
Keywords: | patch added |
---|---|
Milestone: | → 2.0 |
Owner: | removed |
comment:8 by , 14 years ago
Cc: | added |
---|
comment:9 by , 10 years ago
Keywords: | readline libedit macosx patch → readline, libedit, macosx, patch |
---|
comment:10 by , 7 years ago
Milestone: | unscheduled |
---|---|
Resolution: | → wontfix |
Status: | new → closed |
Command completion works fine on OSX 10.12.6 with Python 2.7. I have Python and readline
installed via Brew. The readline
package is recommended in Brew:
$brew info python python: stable 2.7.13 (bottled), HEAD Interpreted, interactive, object-oriented programming language https://www.python.org /usr/local/Cellar/python/2.7.13_1 (3,767 files, 52.3MB) * Poured from bottle on 2017-07-18 at 09:24:23 From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/python.rb ==> Dependencies Build: sphinx-doc ✘, pkg-config ✔ Required: openssl ✔ Recommended: readline ✔, sqlite ✔, gdbm ✔ Optional: sphinx-doc ✘, tcl-tk ✘, berkeley-db@4 ✘ ==> Options [...] --without-readline Build without readline support [...]
As best I can tell, the issue reported in this ticket only occurs with Python 2.5. There's no documented support for libedit
on Python 2.5, but support appears to be documented for Python 2.6 and Python 2.7. However, see also comments in trac-dev:wBiEpCNH654/gU33rJTOAwAJ.
If there are any issue encountered on OSX with Python 2.7, please open a new ticket. We can at least document what is needed to get command completion, whether that be installing readline, pypi:pyreadline or pypi:gnureadline.
If possible, it would be useful to have this in the form of a patch (using
svn diff
or the like). That would make it much easier for people to evaluate the patch, and then apply it to trunk.