unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#32042: 26.1; python.el with ipython prompt leads to superfluous interactive shell output
@ 2018-07-02 20:13 Jaan Altosaar
  2018-07-02 20:32 ` Noam Postavsky
  2018-07-07 14:43 ` Noam Postavsky
  0 siblings, 2 replies; 15+ messages in thread
From: Jaan Altosaar @ 2018-07-02 20:13 UTC (permalink / raw)
  To: 32042

[-- Attachment #1: Type: text/plain, Size: 5533 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 7285 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2021-09-05  7:42 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-02 20:13 bug#32042: 26.1; python.el with ipython prompt leads to superfluous interactive shell output Jaan Altosaar
2018-07-02 20:32 ` Noam Postavsky
2018-07-02 21:18   ` Jaan Altosaar
2018-07-03  0:45     ` Noam Postavsky
2018-07-09 12:59       ` Jaan Altosaar
2018-07-09 19:55         ` Noam Postavsky
     [not found]         ` <mailman.3332.1531166168.1292.bug-gnu-emacs@gnu.org>
2018-07-10 22:09           ` Jaan Altosaar
2018-07-10 22:36             ` Noam Postavsky
     [not found]             ` <mailman.3400.1531262228.1292.bug-gnu-emacs@gnu.org>
2018-07-10 22:51               ` Jaan Altosaar
2018-07-11  0:32                 ` Noam Postavsky
2021-09-05  7:42                   ` Lars Ingebrigtsen
2018-07-10 22:14           ` Jaan Altosaar
     [not found]     ` <mailman.2978.1530578768.1292.bug-gnu-emacs@gnu.org>
2018-07-06 19:21       ` jaan.altosaar
2018-07-07 14:43 ` Noam Postavsky
2018-07-07 16:42   ` Glenn Morris

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).