From: npostavs@users.sourceforge.net
To: charles@aurox.ch (Charles A. Roelli)
Cc: 25753@debbugs.gnu.org
Subject: bug#25753: 25.2; Python mode shell interaction not working 100%
Date: Tue, 28 Feb 2017 09:07:02 -0500 [thread overview]
Message-ID: <87r32icsu1.fsf@users.sourceforge.net> (raw)
In-Reply-To: <m2y3wqfvtn.fsf@aurox.ch> (Charles A. Roelli's message of "Tue, 28 Feb 2017 11:34:12 +0100")
charles@aurox.ch (Charles A. Roelli) writes:
> using `python-shell-interpreter' and `cat | python $'. Python exited
> immediately with code 126, so I guess this solution does not work here.
> But I can't claim to understand any issues having to do with TTYs/"dumb
> terminals", so maybe I am missing something.
The equivalent for python.el would be approximately
(defun my-python-shell-calculate-command (&rest _)
"sh -c \"cat | python -i\"")
(advice-add 'python-shell-calculate-command :override
#'my-python-shell-calculate-command)
But this breaks native completion and prompt detection, due to IO
buffering I think.
>>> So it would seem that `sudo easy_install
>>> gnureadline' is the right thing to run. However that still does not fix
>>> the issue because python2.7/lib-dynload/ comes before
>>> python2.7/site-packages/ (where `gnureadline' is installed) in Python's
>>> $PATH equivalent, `sys.path'. The solution, then, is to reorder the
>>> path somehow or get `readline.so' out of the way (maybe by renaming it
>>> -- cleaner suggestions welcome).
>>
>> I guess renaming should have the least amount of side-effects.
>
> Great. This is what works for me:
>
> cd /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload
> mv readline.so readline.so.bak
>
> Hopefully we can add into emacs-25 a comment about this situation,
> advising Mac OS X users to install `gnureadline' with `easy_install
> gnureadline', then renaming `readline.so' to something not ending in
> `.so', if the native completion does not work immediately.
Does this look okay?
--- i/etc/PROBLEMS
+++ w/etc/PROBLEMS
@@ -463,8 +463,25 @@ problem by adding this to your .cshrc file:
unset edit
stty -icrnl -onlcr -echo susp ^Z
endif
+*** In Inferior Python mode, input is echoed and native completion doesn't work.
+<https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25753>
+
+This happens when python uses a libedit based readline module, which
+is the default on macOS. This can be worked around by installing a
+GNU readline based module instead, for example, using setuptools
+
+ sudo easy_install gnureadline
+
+And then rename the system's readline so that it won't be loaded:
+
+ cd /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload
+ mv readline.so readline.so.bak
+
+See <https://pypi.python.org/pypi/gnureadline> for more details on
+installation.
+
*** Emacs startup on GNU/Linux systems (and possibly other systems) is slow.
This can happen if the system is misconfigured and Emacs can't get the
full qualified domain name, FQDN. You should have your FQDN in the
next prev parent reply other threads:[~2017-02-28 14:07 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-16 16:07 bug#25753: 25.2; Python mode shell interaction not working 100% Charles A. Roelli
2017-02-16 17:54 ` Eli Zaretskii
2017-02-18 17:44 ` npostavs
2017-02-19 15:14 ` Live System User
2017-02-19 15:26 ` Noam Postavsky
2017-02-19 19:39 ` Live System User
2017-02-19 20:00 ` Noam Postavsky
2017-02-19 21:32 ` Live System User
2017-02-20 1:30 ` npostavs
2017-02-20 22:34 ` Live System User
2017-02-21 1:46 ` npostavs
2017-02-21 3:32 ` Live System User
2017-02-21 13:35 ` npostavs
2017-02-21 23:17 ` Live System User
2017-02-22 1:40 ` npostavs
2017-02-22 19:43 ` Charles A. Roelli
2017-02-23 14:20 ` npostavs
2017-02-24 10:19 ` Charles A. Roelli
2017-02-25 14:11 ` Charles A. Roelli
2017-02-25 14:34 ` npostavs
2017-02-25 22:28 ` Charles A. Roelli
2017-02-27 2:14 ` npostavs
2017-02-28 10:34 ` Charles A. Roelli
2017-02-28 14:07 ` npostavs [this message]
2017-02-28 15:56 ` Eli Zaretskii
2017-03-01 23:00 ` npostavs
2021-10-03 16:03 ` Carlos Pita
2021-10-03 16:31 ` Carlos Pita
2021-10-03 23:35 ` Carlos Pita
2021-10-03 23:55 ` Carlos Pita
2021-10-04 0:46 ` Carlos Pita
2021-10-04 15:05 ` Carlos Pita
2021-10-04 8:21 ` Augusto Stoffel
2021-10-04 15:31 ` Carlos Pita
2021-10-04 15:47 ` Augusto Stoffel
2023-08-11 17:55 ` bug#25753: 29.1; " Peter Mao
2023-08-25 5:32 ` Peter Mao
2023-08-25 6:31 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r32icsu1.fsf@users.sourceforge.net \
--to=npostavs@users.sourceforge.net \
--cc=25753@debbugs.gnu.org \
--cc=charles@aurox.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.