From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Jaan Altosaar Newsgroups: gmane.emacs.bugs Subject: bug#32042: 26.1; python.el with ipython prompt leads to superfluous interactive shell output Date: Mon, 2 Jul 2018 17:18:09 -0400 Message-ID: References: <87zhz9l6p9.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000007a27d05700abc52" X-Trace: blaine.gmane.org 1530566229 21443 195.159.176.226 (2 Jul 2018 21:17:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 2 Jul 2018 21:17:09 +0000 (UTC) Cc: "32042@debbugs.gnu.org" <32042@debbugs.gnu.org> To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 02 23:17:04 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fa6C0-0005PW-EX for geb-bug-gnu-emacs@m.gmane.org; Mon, 02 Jul 2018 23:17:04 +0200 Original-Received: from localhost ([::1]:35524 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fa6E5-00079m-R9 for geb-bug-gnu-emacs@m.gmane.org; Mon, 02 Jul 2018 17:19:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35626) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fa6Dy-00077W-R9 for bug-gnu-emacs@gnu.org; Mon, 02 Jul 2018 17:19:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fa6Du-0001z2-QZ for bug-gnu-emacs@gnu.org; Mon, 02 Jul 2018 17:19:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36089) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fa6Du-0001yl-Lh for bug-gnu-emacs@gnu.org; Mon, 02 Jul 2018 17:19:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fa6Du-0001qy-7v for bug-gnu-emacs@gnu.org; Mon, 02 Jul 2018 17:19:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jaan Altosaar Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Jul 2018 21:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32042 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 32042-submit@debbugs.gnu.org id=B32042.15305663057078 (code B ref 32042); Mon, 02 Jul 2018 21:19:02 +0000 Original-Received: (at 32042) by debbugs.gnu.org; 2 Jul 2018 21:18:25 +0000 Original-Received: from localhost ([127.0.0.1]:43986 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fa6DJ-0001q5-6Z for submit@debbugs.gnu.org; Mon, 02 Jul 2018 17:18:25 -0400 Original-Received: from ppa01.princeton.edu ([128.112.128.213]:40742 helo=Princeton.EDU) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fa6DF-0001pq-Rg for 32042@debbugs.gnu.org; Mon, 02 Jul 2018 17:18:22 -0400 Original-Received: from csgsmtp202l.Princeton.EDU (csgsmtp202l.Princeton.EDU [140.180.223.155]) by ppa01.princeton.edu (8.16.0.21/8.16.0.21) with ESMTPS id w62LIF7G001940 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for <32042@debbugs.gnu.org>; Mon, 2 Jul 2018 17:18:15 -0400 Original-Received: from mail-it0-f42.google.com (mail-it0-f42.google.com [209.85.214.42]) (authenticated authid=altosaar bits=0) by csgsmtp202l.Princeton.EDU (8.14.4/8.12.9) with ESMTP id w62LIApw029388 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NOT) for <32042@debbugs.gnu.org>; Mon, 2 Jul 2018 17:18:15 -0400 Original-Received: by mail-it0-f42.google.com with SMTP id v83-v6so265081itc.3 for <32042@debbugs.gnu.org>; Mon, 02 Jul 2018 14:18:15 -0700 (PDT) X-Gm-Message-State: APt69E3yIOKgjaHXuxl1+Enp7jClpQEpCXGhCImqBnIiwEbVBE7dFlkt 9TCODnnJAg4W6Yq7iwcyCXHCIZ5F/EPAVYu2okw= X-Google-Smtp-Source: AAOMgpdWDowGPgvb8olZkvN4BpNtxWKxitgNnx5NnGVxWL9yLz3Nk/k7Fx9LpWGy3vHfembp+Sllfau0qct5KzSLBvU= X-Received: by 2002:a24:cf57:: with SMTP id y84-v6mr7424448itf.98.1530566290152; Mon, 02 Jul 2018 14:18:10 -0700 (PDT) Original-Received: by 2002:a6b:b5c9:0:0:0:0:0 with HTTP; Mon, 2 Jul 2018 14:18:09 -0700 (PDT) In-Reply-To: <87zhz9l6p9.fsf@gmail.com> X-Gmail-Original-Message-ID: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-07-02_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=quarantine_notspam policy=quarantine score=0 suspectscore=2 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807020237 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:148128 Archived-At: --00000000000007a27d05700abc52 Content-Type: text/plain; charset="UTF-8" Thanks! I installed gnureadline. I could not rename the readline.so file as the file moved to the /System/Library path in Mac High Sierra. FWIW I am not using the system python, but Anaconda 3 python (ipython 6.4.0). Python 3.6.5 |Anaconda custom (64-bit)| (default, Apr 26 2018, 08:42:37). Is there anything else I should try? On Monday, July 2, 2018, Noam Postavsky wrote: > merge 32042 25753 > quit > > Jaan Altosaar writes: > > > File "", line 1, in > > import codecs, os;__pyfile = > > codecs.open('''/var/folders/qr/s_h2rhqj6kdg8qrj0zw2scnw0000g > n/T/pyLbk6Vh''', > > encoding='''utf-8''');__code = > > __pyfile.read().encode('''utf-8''');__pyfile.close();os.remo > ve('''/var/folders/qr/s_h2rhqj6kdg8qrj0zw2scnw0000gn/T/ > pyLbk6Vh''');exec(compile(__code, > > '''/Users/jaan/tmp/test.py''', 'exec')); > > > Is there any way to clean up the output, especially the parts involving > > `codecs.open('''/var/folders/qr/s_h2rhqj6kdg8qrj0zw2scnw0000 > gn/T/pyLbk6Vh'''`? > > Try installing gnureadline, as described in etc/PROBLEMS: > > *** In Inferior Python mode, input is echoed and native completion > doesn't work. > > > 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/python > 2.7/lib-dynload > mv readline.so readline.so.bak > > See for more details on > installation. > > > --00000000000007a27d05700abc52 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks!

I installed gnureadline. I could not rename the = readline.so file as the file moved to the /System/Library path in Mac High = Sierra.

FWIW I am not using the system python, but= Anaconda 3 python (ipython 6.4.0).=C2=A0

Python 3= .6.5 |Anaconda custom (64-bit)| (default, Apr 26 2018, 08:42:37).

Is there anything else I should try?

On Monday, July= 2, 2018, Noam Postavsky <npostavs@gmail.com> wrote:
merge 32042 25753
quit

Jaan Altosaar <altosaar@princeton.edu> writes:

>=C2=A0 =C2=A0File "<ipython-input-1-57ce0cd600e5>"= , line 1, in <module>
>=C2=A0 =C2=A0 =C2=A0import codecs, os;__pyfile =3D
> codecs.open('''/var/folders/qr/s_h2rhqj6kdg8qrj0zw2sc= nw0000gn/T/pyLbk6Vh''',
> encoding=3D'''utf-8''');__code =3D
> __pyfile.read().encode('''utf-8''');__pyf= ile.close();os.remove('''/var/folders/qr/s_h2rhqj6kdg= 8qrj0zw2scnw0000gn/T/pyLbk6Vh''');exec(compile(__code= ,
> '''/Users/jaan/tmp/test.py''', 'exec')= );

> Is there any way to clean up the output, especially the parts involvin= g
> `codecs.open('''/var/folders/qr/s_h2rhqj6kdg8qrj0zw2s= cnw0000gn/T/pyLbk6Vh'''`?

Try installing gnureadline, as described in etc/PROBLEMS:

=C2=A0 =C2=A0 *** In Inferior Python mode, input is echoed and native compl= etion doesn't work.
=C2=A0 =C2=A0 <https://debbugs.gnu.org/cgi/bugreport.cgi?= bug=3D25753>

=C2=A0 =C2=A0 This happens when python uses a libedit based readline module= , which
=C2=A0 =C2=A0 is the default on macOS.=C2=A0 This can be worked around by i= nstalling a
=C2=A0 =C2=A0 GNU readline based module instead, for example, using setupto= ols

=C2=A0 =C2=A0 =C2=A0 =C2=A0 sudo easy_install gnureadline

=C2=A0 =C2=A0 And then rename the system's readline so that it won'= t be loaded:

=C2=A0 =C2=A0 =C2=A0 =C2=A0 cd /Library/Frameworks/Python.framework/Ve= rsions/2.7/lib/python2.7/lib-dynload
=C2=A0 =C2=A0 =C2=A0 =C2=A0 mv readline.so readline.so.bak

=C2=A0 =C2=A0 See <https://pypi.python.org/pypi/gnureadline> for= more details on
=C2=A0 =C2=A0 installation.


--00000000000007a27d05700abc52--