On Thursday, August 17, 2017 at 7:54:30 AM UTC-4, Emmanuel Blot wrote:
>
> 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.
>
Yeah, I've found that I need to recreate my virtualenvs whenever Brew's
Python is upgraded. I get an error like "cannot read image". Since my
virtualenvs for trac development are always the same, I just wrote a script
to recreate the virtualenv, so it's no trouble now that I know what
behavior to expect.
> 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.
>
That looks interesting. We could reorder the operations to prefer
pyreadline when installed:
try:
import pyreadline as rl
except ImportError:
try:
import readline as rl
except ImportError:
rl = None
- Ryan
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/trac-dev.
For more options, visit https://groups.google.com/d/optout.