GNU bug report logs - #32042
26.1; python-shell-send-buffer with ipython 6.x shows "plumbing" code along with python error message

Previous Next

Package: emacs;

Reported by: Jaan Altosaar <altosaar <at> princeton.edu>

Date: Mon, 2 Jul 2018 20:25:02 UTC

Severity: normal

Tags: confirmed

Found in versions 24.5, 25.1, 25.2, 26.1

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 32042 in the body.
You can then email your comments to 32042 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#32042; Package emacs. (Mon, 02 Jul 2018 20:25:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jaan Altosaar <altosaar <at> princeton.edu>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 02 Jul 2018 20:25:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jaan Altosaar <altosaar <at> princeton.edu>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.1; python.el with ipython prompt leads to superfluous interactive
 shell output
Date: Mon, 2 Jul 2018 16:13:14 -0400
[Message part 1 (text/plain, inline)]
Here is how I'm starting emacs, with these contents of init.el:
```
(setq
 python-shell-interpreter "ipython"
 python-shell-interpreter-args "--simple-prompt --classic --nosep"
)
```
Then if I open a file `~/tmp/test.py` with the contents:

```
print('test printing')
print('test bug)
```

And run it using `M-x run-python` then `M-x python-shell-send-buffer`,
the output is quite messy:

```
Python 3.6.5 |Anaconda custom (64-bit)| (default, Apr 26 2018, 08:42:37)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.4.0 -- An enhanced Interactive Python. Type '?' for help.
>>> Traceback (most recent call last):

  File
"/usr/local/anaconda3/lib/python3.6/site-packages/IPython/core/interactiveshell.py",
line 2963, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)

  File "<ipython-input-1-57ce0cd600e5>", line 1, in <module>
    import codecs, os;__pyfile =
codecs.open('''/var/folders/qr/s_h2rhqj6kdg8qrj0zw2scnw0000gn/T/pyLbk6Vh''',
encoding='''utf-8''');__code =
__pyfile.read().encode('''utf-8''');__pyfile.close();os.remove('''/var/folders/qr/s_h2rhqj6kdg8qrj0zw2scnw0000gn/T/pyLbk6Vh''');exec(compile(__code,
'''/Users/jaan/tmp/test.py''', 'exec'));

  File "/Users/jaan/tmp/test.py", line 2
    print('test bug)
                    ^
SyntaxError: EOL while scanning string literal
```

Is there any way to clean up the output, especially the parts involving
`codecs.open('''/var/folders/qr/s_h2rhqj6kdg8qrj0zw2scnw0000gn/T/pyLbk6Vh'''`?

Thanks so much! Emacs newbie here, may be missing something basic...


In GNU Emacs 26.1 (build 1, x86_64-apple-darwin17.5.0)
 of 2018-06-02 built on 172-16-42-187.DYNAPOOL.NYU.EDU
Recent messages:
Searching for ‘test.py’.... [2 times]
(New file)
Saving file /Users/jaan/tmp/test.py...
Wrote /Users/jaan/tmp/test.py
user-error: Start a Python process first with ‘M-x run-python’ or ‘C-c C-p’.
Shell native completion is disabled, using fallback
Sent: print('test printing')...
Mark set
Quit
user-error: Current buffer has no process
Quit
Configured using:
 'configure --disable-dependency-tracking --disable-silent-rules
 --enable-locallisppath=/usr/local/share/emacs/site-lisp
 --infodir=/usr/local/Cellar/emacs/26.1_1/share/info/emacs
 --prefix=/usr/local/Cellar/emacs/26.1_1 --with-gnutls --without-x
 --with-xml2 --without-dbus --with-imagemagick --with-rsvg --without-ns'

Configured features:
JPEG NOTIFY ACL GNUTLS LIBXML2 ZLIB THREADS LCMS2

Important settings:
  value of $LC_ALL: en_US.UTF-8
  value of $LC_CTYPE: en_US.UTF-8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Inferior Python

Minor modes in effect:
  compilation-shell-minor-mode: t
  shell-dirtrack-mode: t
  diff-auto-refine-mode: t
  helm-mode: t
  async-bytecomp-package-mode: t
  xclip-mode: t
  ido-everywhere: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  global-visual-line-mode: 1
  visual-line-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa derived epg gnus-util rmail rmail-loaddefs
mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils
mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr
mail-utils ffap compile python tramp-sh tramp tramp-compat
tramp-loaddefs trampver ucs-normalize shell pcomplete parse-time json
map comint regexp-opt ansi-color vc-git diff-mode image winner thingatpt
cl-extra help-mode helm-command helm-elisp helm-eval edebug helm-info
ring info tool-bar misearch multi-isearch term/xterm xterm time-date
elec-pair helm-mode helm-files helm-buffers helm-tags helm-locate
helm-grep helm-regexp format-spec helm-utils helm-help helm-types helm
easy-mmode helm-source eieio-compat helm-multi-match helm-lib
helm-config helm-easymenu async-bytecomp advice async xclip edmacro
kmacro solarized-theme solarized-definitions ido finder-inf package
easymenu epg-config url-handlers url-parse auth-source cl-seq eieio
eieio-core cl-macs eieio-loaddefs password-cache url-vars seq byte-opt
gv bytecomp byte-compile cconv cl-loaddefs cl-lib mule-util tooltip
eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow isearch timer select mouse
jit-lock font-lock syntax facemenu font-core term/tty-colors frame
cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai
tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian
slovak czech european ethiopic indian cyrillic chinese composite
charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev
obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face
macroexp files text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget hashtable-print-readable backquote kqueue
lcms2 multi-tty make-network-process emacs)

Memory information:
((conses 16 405604 13728)
 (symbols 48 31824 1)
 (miscs 40 176 376)
 (strings 32 78802 1488)
 (string-bytes 1 2336041)
 (vectors 16 50728)
 (vector-slots 8 892846 8650)
 (floats 8 126 1059)
 (intervals 56 4765 66)
 (buffers 992 20))
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32042; Package emacs. (Mon, 02 Jul 2018 20:33:02 GMT) Full text and rfc822 format available.

Message #8 received at 32042 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: Jaan Altosaar <altosaar <at> princeton.edu>
Cc: 32042 <at> debbugs.gnu.org
Subject: Re: bug#32042: 26.1;
 python.el with ipython prompt leads to superfluous interactive shell
 output
Date: Mon, 02 Jul 2018 16:32:18 -0400
merge 32042 25753
quit

Jaan Altosaar <altosaar <at> princeton.edu> writes:

>   File "<ipython-input-1-57ce0cd600e5>", line 1, in <module>
>     import codecs, os;__pyfile =
> codecs.open('''/var/folders/qr/s_h2rhqj6kdg8qrj0zw2scnw0000gn/T/pyLbk6Vh''',
> encoding='''utf-8''');__code =
> __pyfile.read().encode('''utf-8''');__pyfile.close();os.remove('''/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_h2rhqj6kdg8qrj0zw2scnw0000gn/T/pyLbk6Vh'''`?

Try installing gnureadline, as described in etc/PROBLEMS:

    *** 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.






Merged 21431 22796 25753 26326 32042. Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Mon, 02 Jul 2018 20:33:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32042; Package emacs. (Mon, 02 Jul 2018 21:19:02 GMT) Full text and rfc822 format available.

Message #13 received at 32042 <at> debbugs.gnu.org (full text, mbox):

From: Jaan Altosaar <altosaar <at> princeton.edu>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: "32042 <at> debbugs.gnu.org" <32042 <at> debbugs.gnu.org>
Subject: Re: 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 part 1 (text/plain, inline)]
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 <npostavs <at> gmail.com> wrote:

> merge 32042 25753
> quit
>
> Jaan Altosaar <altosaar <at> princeton.edu> writes:
>
> >   File "<ipython-input-1-57ce0cd600e5>", line 1, in <module>
> >     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.
>     <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/python
> 2.7/lib-dynload
>         mv readline.so readline.so.bak
>
>     See <https://pypi.python.org/pypi/gnureadline> for more details on
>     installation.
>
>
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32042; Package emacs. (Tue, 03 Jul 2018 00:46:01 GMT) Full text and rfc822 format available.

Message #16 received at 32042 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: Jaan Altosaar <altosaar <at> princeton.edu>
Cc: "32042 <at> debbugs.gnu.org" <32042 <at> debbugs.gnu.org>
Subject: Re: bug#32042: 26.1;
 python.el with ipython prompt leads to superfluous interactive shell
 output
Date: Mon, 02 Jul 2018 20:45:45 -0400
Jaan Altosaar <altosaar <at> princeton.edu> writes:

> 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?

You mean there was no change?  Perhaps instead of the /System/Library
path you need to find where the libedit readline is installed for
Anaconda.  Although I'm not sure where that would be.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32042; Package emacs. (Sat, 07 Jul 2018 14:45:01 GMT) Full text and rfc822 format available.

Message #19 received at 32042 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: 32042 <at> debbugs.gnu.org
Cc: jaan.altosaar <at> gmail.com
Subject: Re: bug#32042: 26.1;
 python.el with ipython prompt leads to superfluous interactive shell
 output
Date: Sat, 07 Jul 2018 10:43:57 -0400
[Message part 1 (text/plain, inline)]
[your message doesn't seem to show up on the bug thread, please use
"Reply All" to keep 32042 <at> debbugs.gnu.org on Cc]

[Message part 2 (message/rfc822, inline)]
From: jaan.altosaar <at> gmail.com
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#32042: 26.1; python.el with ipython prompt leads to superfluous interactive shell output
Date: Fri, 6 Jul 2018 12:21:52 -0700 (PDT)
There was no change; I still see the broken output in the original post...

```File "<ipython-input-1-57ce0cd600e5>", line 1, in <module>
    import codecs, os;__pyfile = codecs.open('''/var/folders/qr/s_h2rhqj6kdg8qrj0zw2scnw0000gn/T/pyLbk6Vh''', encoding='''utf-8''')
```

I tried:

Disabling system integrity protection (booting into OS X High Sierra recovery mode and running `csrutil disable`), then 

```
cd /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload 
sudo mv readline.so readline.so.bak
```

and the same for the anaconda readline:

```
cd /usr/local/anaconda3/lib/python3.6/lib-dynload
mv readline.cpython-36m-darwin.so readline.cpython-36m-darwin.so.bak
```

And installing gnureadline.

Still getting the same broken output.
forwarding to list
Any other ideas?
[Message part 3 (text/plain, inline)]

Try in a python shell:

    print (readline.__doc__)
    print (readline.__file__)

The first to confirm that libedit readline is still being loaded, the
second to hopefully give some kind of hint where it's coming from.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32042; Package emacs. (Sat, 07 Jul 2018 16:43:01 GMT) Full text and rfc822 format available.

Message #22 received at 32042 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: 32042 <at> debbugs.gnu.org, jaan.altosaar <at> gmail.com
Subject: Re: bug#32042: 26.1;
 python.el with ipython prompt leads to superfluous interactive shell
 output
Date: Sat, 07 Jul 2018 12:42:28 -0400
Noam Postavsky wrote:

> [your message doesn't seem to show up on the bug thread, please use

It's because he posted via the newsgroup (I wish it would go away), not mail.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32042; Package emacs. (Mon, 09 Jul 2018 13:00:02 GMT) Full text and rfc822 format available.

Message #25 received at 32042 <at> debbugs.gnu.org (full text, mbox):

From: Jaan Altosaar <altosaar <at> princeton.edu>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: "32042 <at> debbugs.gnu.org" <32042 <at> debbugs.gnu.org>
Subject: Re: bug#32042: 26.1; python.el with ipython prompt leads to
 superfluous interactive shell output
Date: Mon, 9 Jul 2018 08:59:13 -0400
[Message part 1 (text/plain, inline)]
My bad! Reply alling to keep 32042 <at> debbugs.gnu.org in cc. Hope this works—

There was no change; I still see the broken output in the original post...

```File "<ipython-input-1-57ce0cd600e5>", line 1, in <module>
    import codecs, os;__pyfile =
codecs.open('''/var/folders/qr/s_h2rhqj6kdg8qrj0zw2scnw0000gn/T/pyLbk6Vh''',
encoding='''utf-8''')
```

I tried:

Disabling system integrity protection (booting into OS X High Sierra
recovery mode and running `csrutil disable`), then

```
cd
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload
sudo mv readline.so readline.so.bak
```

and the same for the anaconda readline:

```
cd /usr/local/anaconda3/lib/python3.6/lib-dynload
mv readline.cpython-36m-darwin.so readline.cpython-36m-darwin.so.bak
```

And installing gnureadline.

Still getting the same broken output.

Any other ideas?

On Monday, July 2, 2018, Noam Postavsky <npostavs <at> gmail.com> wrote:

> Jaan Altosaar <altosaar <at> princeton.edu> writes:
>
> > 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?
>
> You mean there was no change?  Perhaps instead of the /System/Library
> path you need to find where the libedit readline is installed for
> Anaconda.  Although I'm not sure where that would be.
>
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32042; Package emacs. (Mon, 09 Jul 2018 19:56:02 GMT) Full text and rfc822 format available.

Message #28 received at 32042 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: Jaan Altosaar <altosaar <at> princeton.edu>
Cc: "32042 <at> debbugs.gnu.org" <32042 <at> debbugs.gnu.org>
Subject: Re: bug#32042: 26.1; python.el with ipython prompt leads to
 superfluous interactive shell output
Date: Mon, 9 Jul 2018 15:55:47 -0400
On 9 July 2018 at 08:59, Jaan Altosaar <altosaar <at> princeton.edu> wrote:
> My bad! Reply alling to keep 32042 <at> debbugs.gnu.org in cc. Hope this works—

> Still getting the same broken output.
>
> Any other ideas?

Can you show the result of the python expressions at the bottom of
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32042#19




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32042; Package emacs. (Tue, 10 Jul 2018 22:10:01 GMT) Full text and rfc822 format available.

Message #31 received at 32042 <at> debbugs.gnu.org (full text, mbox):

From: Jaan Altosaar <altosaar <at> princeton.edu>
To: "gnu.emacs.bug <at> googlegroups.com" <gnu.emacs.bug <at> googlegroups.com>
Cc: "32042 <at> debbugs.gnu.org" <32042 <at> debbugs.gnu.org>
Subject: Re: bug#32042: 26.1; python.el with ipython prompt leads to
 superfluous interactive shell output
Date: Tue, 10 Jul 2018 18:09:34 -0400
[Message part 1 (text/plain, inline)]
Thanks!

 It looks like it's the anaconda readline:

```
Python 3.6.6 |Anaconda custom (64-bit)| (default, Jun 28 2018, 11:07:29)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.4.0 -- An enhanced Interactive Python. Type '?' for help.
>>> import readline; print(readline.__doc__); print(readline.__file__)
Importing this module enables command line editing using GNU readline.
/usr/local/anaconda3/lib/python3.6/site-packages/
readline.cpython-36m-darwin.so
```

I tried using gnureadline too but get the same broken output.

```
>>> import readline
>>> print(readline.__doc__); print(readline.__file__)
Importing this module enables command line editing using GNU readline.
/usr/local/anaconda3/lib/python3.6/site-packages/readline.py
>>> cat /usr/local/anaconda3/lib/python3.6/site-packages/readline.py
from gnureadline import *
from gnureadline import __doc__
```

On Monday, July 9, 2018, Noam Postavsky <npostavs <at> gmail.com> wrote:

> On 9 July 2018 at 08:59, Jaan Altosaar <altosaar <at> princeton.edu> wrote:
> > My bad! Reply alling to keep 32042 <at> debbugs.gnu.org in cc. Hope this
> works—
>
> > Still getting the same broken output.
> >
> > Any other ideas?
>
> Can you show the result of the python expressions at the bottom of
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32042#19
>
>
>
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32042; Package emacs. (Tue, 10 Jul 2018 22:15:01 GMT) Full text and rfc822 format available.

Message #34 received at 32042 <at> debbugs.gnu.org (full text, mbox):

From: Jaan Altosaar <altosaar <at> princeton.edu>
To: 32042 <at> debbugs.gnu.org
Subject: Re: bug#32042: 26.1; python.el with ipython prompt leads to
 superfluous interactive shell output
Date: Tue, 10 Jul 2018 18:14:42 -0400
[Message part 1 (text/plain, inline)]
Thanks! It looks like it's the anaconda readline:

```
Python 3.6.6 |Anaconda custom (64-bit)| (default, Jun 28 2018, 11:07:29)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.4.0 -- An enhanced Interactive Python. Type '?' for help.
>>> import readline; print(readline.__doc__); print(readline.__file__)
Importing this module enables command line editing using GNU readline.
/usr/local/anaconda3/lib/python3.6/site-packages/
readline.cpython-36m-darwin.so
```

I tried using gnureadline too but get the same broken output.

```
>>> import readline
>>> print(readline.__doc__); print(readline.__file__)
Importing this module enables command line editing using GNU readline.
/usr/local/anaconda3/lib/python3.6/site-packages/readline.py
>>> cat /usr/local/anaconda3/lib/python3.6/site-packages/readline.py
from gnureadline import *
from gnureadline import __doc__
```

On Monday, July 9, 2018, Noam Postavsky <npostavs <at> gmail.com> wrote:

> On 9 July 2018 at 08:59, Jaan Altosaar <altosaar <at> princeton.edu> wrote:
> > My bad! Reply alling to keep 32042 <at> debbugs.gnu.org in cc. Hope this
> works—
>
> > Still getting the same broken output.
> >
> > Any other ideas?
>
> Can you show the result of the python expressions at the bottom of
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32042#19
>
>
>
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32042; Package emacs. (Tue, 10 Jul 2018 22:37:02 GMT) Full text and rfc822 format available.

Message #37 received at 32042 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: Jaan Altosaar <altosaar <at> princeton.edu>
Cc: "32042 <at> debbugs.gnu.org" <32042 <at> debbugs.gnu.org>
Subject: Re: bug#32042: 26.1;
 python.el with ipython prompt leads to superfluous interactive shell
 output
Date: Tue, 10 Jul 2018 18:36:02 -0400
Jaan Altosaar <altosaar <at> princeton.edu> writes:

> Python 3.6.6 |Anaconda custom (64-bit)| (default, Jun 28 2018, 11:07:29)
> Type 'copyright', 'credits' or 'license' for more information
> IPython 6.4.0 -- An enhanced Interactive Python. Type '?' for help.
>>>> import readline; print(readline.__doc__); print(readline.__file__)
> Importing this module enables command line editing using GNU readline.

Hmm, maybe it's not the same problem then.  Do you see the same "using
GNU readline" output when doing the same from within Emacs?

PS now your messages are arriving in duplicate for some reason.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32042; Package emacs. (Tue, 10 Jul 2018 22:52:01 GMT) Full text and rfc822 format available.

Message #40 received at 32042 <at> debbugs.gnu.org (full text, mbox):

From: Jaan Altosaar <altosaar <at> princeton.edu>
To: "gnu.emacs.bug <at> googlegroups.com" <gnu.emacs.bug <at> googlegroups.com>
Cc: "32042 <at> debbugs.gnu.org" <32042 <at> debbugs.gnu.org>
Subject: Re: bug#32042: 26.1; python.el with ipython prompt leads to
 superfluous interactive shell output
Date: Tue, 10 Jul 2018 18:51:32 -0400
[Message part 1 (text/plain, inline)]
This is from within emacs.

Contents of init.el:

```
(setq
 python-shell-interpreter "ipython"
 python-shell-interpreter-args "--simple-prompt --classic --nosep"
)
```

And launching the prompt with `M-x run-python`.

Sorry for the double messages; I resent only to
32042 <at> debbugs.gnu.org because I received this message:

Address not found
Your message wasn't delivered to gnu.emacs.bug <at> googlegroups.com because the
address couldn't be found, or is unable to receive mail.

On Tuesday, July 10, 2018, Noam Postavsky <npostavs <at> gmail.com> wrote:

> Jaan Altosaar <altosaar <at> princeton.edu> writes:
>
> > Python 3.6.6 |Anaconda custom (64-bit)| (default, Jun 28 2018, 11:07:29)
> > Type 'copyright', 'credits' or 'license' for more information
> > IPython 6.4.0 -- An enhanced Interactive Python. Type '?' for help.
> >>>> import readline; print(readline.__doc__); print(readline.__file__)
> > Importing this module enables command line editing using GNU readline.
>
> Hmm, maybe it's not the same problem then.  Do you see the same "using
> GNU readline" output when doing the same from within Emacs?
>
> PS now your messages are arriving in duplicate for some reason.
>
>
>
>
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32042; Package emacs. (Wed, 11 Jul 2018 00:33:01 GMT) Full text and rfc822 format available.

Message #43 received at 32042 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: Jaan Altosaar <altosaar <at> princeton.edu>
Cc: "32042 <at> debbugs.gnu.org" <32042 <at> debbugs.gnu.org>
Subject: Re: bug#32042: 26.1;
 python.el with ipython prompt leads to superfluous interactive shell
 output
Date: Tue, 10 Jul 2018 20:32:33 -0400
unmerge 32042
tags 32042 + confirmed
retitle 32042 26.1; python-shell-send-buffer with ipython 6.x shows "plumbing" code along with python error message
quit

Jaan Altosaar <altosaar <at> princeton.edu> writes:

> This is from within emacs.

Oh right, I forgot the bad output only happens when you send from file
or buffer.

I dusted off my Arch box, and I can see the same problem there (it has
ipython 6.3.1).  I don't see it on my normal Debian box which has
ipython 5.1.0.  So something must have changed in ipython's behaviour.

> Sorry for the double messages; I resent only to
> 32042 <at> debbugs.gnu.org because I received this message:
>
> Address not found
> Your message wasn't delivered to gnu.emacs.bug <at> googlegroups.com because the
> address couldn't be found, or is unable to receive mail.

Ah, the gnu.emacs.bug <at> googlegroups.com email address is indeed bogus,
but as long as the 32042 <at> debbugs.gnu.org message goes through, the bug
tracker is fine.





Disconnected #32042 from all other report(s). Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 11 Jul 2018 00:33:02 GMT) Full text and rfc822 format available.

Added tag(s) confirmed. Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 11 Jul 2018 00:33:02 GMT) Full text and rfc822 format available.

Changed bug title to '26.1; python-shell-send-buffer with ipython 6.x shows "plumbing" code along with python error message' from '26.1; python.el with ipython prompt leads to superfluous interactive shell output' Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 11 Jul 2018 00:33:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32042; Package emacs. (Sun, 05 Sep 2021 07:42:01 GMT) Full text and rfc822 format available.

Message #52 received at 32042 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Augusto Stoffel <arstoffel <at> gmail.com>
Cc: 49822 <at> debbugs.gnu.org, 32042 <at> debbugs.gnu.org,
 Stefan Monnier <monnier <at> iro.umontreal.ca>, emacs-devel <at> gnu.org
Subject: Re: bug#49822: master e32c7d2: Change Python eval to send directly
 instead of using temporary files
Date: Sun, 05 Sep 2021 09:41:37 +0200
Augusto Stoffel <arstoffel <at> gmail.com> writes:

> I've attached a patch that reverts to using temporary files for
> sufficiently long strings (would this magic 4096 ever require
> customization?).  The patch also solves bug#32042, which is mostly
> unrelated.

Thanks; pushed to Emacs 28 (and I guess I'll close bug#32042, then).

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32042; Package emacs. (Sun, 05 Sep 2021 07:44:01 GMT) Full text and rfc822 format available.

Message #55 received at 32042 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: "32042 <at> debbugs.gnu.org" <32042 <at> debbugs.gnu.org>,
 Jaan Altosaar <altosaar <at> princeton.edu>
Subject: Re: bug#32042: 26.1; python.el with ipython prompt leads to
 superfluous interactive shell output
Date: Sun, 05 Sep 2021 09:42:44 +0200
Noam Postavsky <npostavs <at> gmail.com> writes:

> unmerge 32042
> tags 32042 + confirmed
> retitle 32042 26.1; python-shell-send-buffer with ipython 6.x shows
> "plumbing" code along with python error message
> quit

This should now be fixed in Emacs 28 with:

commit c9b173ffea1fe41da385cea135c894fcf523e917 (HEAD -> master)
Author:     Augusto Stoffel <arstoffel <at> gmail.com>
AuthorDate: Sat Sep 4 11:16:11 2021 +0200

So I'm closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 28.1, send any further explanations to 32042 <at> debbugs.gnu.org and Jaan Altosaar <altosaar <at> princeton.edu> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 05 Sep 2021 07:44:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 03 Oct 2021 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 200 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.