GNU bug report logs -
#50669
28.0.50; python-shell-send-string leads to "nesting exceeds `max-lisp-eval-depth`" error
Previous Next
Reported by: Michael-David Fiszer <sguibor <at> gmail.com>
Date: Sun, 19 Sep 2021 02:42:01 UTC
Severity: normal
Tags: moreinfo
Found in version 28.0.50
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hi,
I'm not an expert in how python.el internals work, but I started getting
this error every time I would send a statement to the shell. In addition I
would get these weird printouts of blocks of the form
```
def __PYDOC_get_help(obj):
try:
import inspect
try:
str_type = basestring
argspec_function = inspect.getargspec
except NameError:
str_type = str
```
while just moving the point in my .py file.
My current workaround was to simply override python-shell-send-string from
28.0.50 with the one I had with my emacs 27 version, which was:
```
(defun python-shell-send-string (string &optional process msg)
"Send STRING to inferior Python PROCESS.
When optional argument MSG is non-nil, forces display of a
user-friendly message if there's no process running; defaults to
t when called interactively."
(interactive
(list (read-string "Python command: ") nil t))
(let ((process (or process (python-shell-get-process-or-error msg))))
(if (string-match ".\n+." string) ;Multiline.
(let* ((temp-file-name (python-shell--save-temp-file string))
(file-name (or (buffer-file-name) temp-file-name)))
(python-shell-send-file file-name process temp-file-name t))
(when (or (not (string-match "\n\\'" string))
(string-match "\n[ \t].*\n?\\'" string))
(comint-send-string process "\n")))))
```
And this seems to solve the problem...
In GNU Emacs 28.0.50 (build 1, x86_64-apple-darwin20.6.0, NS appkit-2022.60
Version 11.6 (Build 20G165))
of 2021-09-17 built on mdfz-macbookpro4.roam.corp.google.com
Windowing system distributor 'Apple', version 10.3.2022
System Description: macOS 11.6
Configured using:
'configure --disable-dependency-tracking --disable-silent-rules
--enable-locallisppath=/usr/local/share/emacs/site-lisp
--infodir=/usr/local/Cellar/emacs-plus <at> 28/28.0.50/share/info/emacs
--prefix=/usr/local/Cellar/emacs-plus <at> 28/28.0.50 --with-xml2 --with-gnutls
--without-dbus --with-imagemagick --with-modules --with-rsvg --with-ns
--disable-ns-self-contained'
Configured features:
ACL GLIB GMP GNUTLS IMAGEMAGICK JPEG JSON LCMS2 LIBXML2 MODULES NOTIFY
KQUEUE NS
PDUMPER PNG RSVG THREADS TIFF TOOLKIT_SCROLL_BARS XIM ZLIB
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: mu4e-headers
Memory information:
((conses 16 1905022 1639005)
(symbols 48 123242 97)
(strings 32 433582 151543)
(string-bytes 1 14825386)
(vectors 16 192606)
(vector-slots 8 3165377 831342)
(floats 8 1100 6586)
(intervals 56 34684 19693)
(buffers 992 60))
[Message part 2 (text/html, inline)]
This bug report was last modified 2 years and 333 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.