Hi Ryan, I have not used trac on OSX for a while, but I’ve extracted the command line interpreter from trac-admin to test-drive several IoT projects. I’m not using Python 2.x either (AFAICT, among the numerous Python projects/modules I use on a regular basis, Trac is the only one that still requires Python 2.x :-)).
However, whenever I need Python on macOs, whether it’s Python 2.7.x or Python 3.x, I install it from (home)brew, and I now always use the excellent pyreadline library in replacement of the native GNU readline - another native dependency dropped for a pure Python module. One special attention with brew is that it’s quite easy to break a working installation, when the minor Python version is automatically updated (from 3.5 to 3.6 for example). Either the Python installation needs to be pinned down (‘brew pin’) or the proper virtual env should be set up. The snippet that goes into the equivalent of console.py now looks like: try: import readline as rl except ImportError: try: import pyreadline as rl except ImportError: rl = None I’ve observed no regression while using the Python implementation vs. the native library. HTH, Manu On Mon, Aug 14, 2017 at 1:54 AM, RjOllos <rjol...@gmail.com> wrote: > > > On Thursday, June 9, 2011 at 6:35:30 AM UTC-7, Emmanuel Blot wrote: >> >> >> Not that I know of. It's working fine here (Mac OS X 10.5.?), but I'm >> >> using Python from MacPorts, so I don't know about the stock installed >> >> Python. >> >> Follow up: >> >> To make it work with the system Python, the Python readline library >> should be used (this is a Mac OS X specific issue, as Mac OS X is >> shipped with libedit instead of GNU readline), see >> http://pypi.python.org/pypi/readline >> >> 1/ Install this package with easy_install (not with pip, or you'll >> have to deal with a sys.path inclusion order issue): >> sudo easy_install readline >> >> 2/ Check out your installation >> python >> import readline >> readline.__file__ >> >> should report the newly installed readline library (/Library/...) >> if it reports the system library (/System/Library/...) the defaut >> readline module will be used, and tab completion will not work. >> >> HTH, >> Manu >> > > I made some comments when closing #6695 (1). I have Python 2.7.13 > installed via Homebrew, and readline is installed as well. > > I tested the default Python 2.6.9 that ships with OSX and there's no > command-completion. > $python > Python 2.6.9 (unknown, Feb 7 2017, 00:08:08) > [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin > Type "help", "copyright", "credits" or "license" for more information. > >>> import readline > >>> readline.__doc__ > 'Importing this module enables command line editing using libedit > readline.' > > Installing gnureadline (2), which is a replacement for readline on pypi, > doesn't seem to fix the issue. > > I'd like to improve the documentation for TracAdmin (3) if anyone can > demonstrate more accurately when readline may be needed on OSX. I'm mainly > concerned with Python 2.7 since Trac is moving towards dropping support for > all earlier versions of Python. Since OSX does not appear to provide Python > 2.7, it must be installed somehow, so I'd be interested to know if command > completion works after installing the official Python distribution for OSX > (4). > > Thanks, > - Ryan > > (1) https://trac.edgewall.org/ticket/6695#comment:10 > (2) https://pypi.python.org/pypi/gnureadline > (3) https://trac.edgewall.org/wiki/TracAdmin > (4) https://www.python.org/downloads/release/python-2713/ > > -- > You received this message because you are subscribed to the Google Groups > "Trac Development" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to trac-dev+unsubscr...@googlegroups.com. > To post to this group, send email to trac-dev@googlegroups.com. > Visit this group at https://groups.google.com/group/trac-dev. > For more options, visit https://groups.google.com/d/optout. > -- Manu -- You received this message because you are subscribed to the Google Groups "Trac Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to trac-dev+unsubscr...@googlegroups.com. To post to this group, send email to trac-dev@googlegroups.com. Visit this group at https://groups.google.com/group/trac-dev. For more options, visit https://groups.google.com/d/optout.