From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael-David Fiszer Newsgroups: gmane.emacs.bugs Subject: bug#50669: 28.0.50; python-shell-send-string leads to "nesting exceeds `max-lisp-eval-depth`" error Date: Sun, 19 Sep 2021 03:32:30 +0300 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000006b175305cc4e4dd8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40171"; mail-complaints-to="usenet@ciao.gmane.io" To: 50669@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 19 04:42:11 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mRmmQ-000AKU-Bn for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 19 Sep 2021 04:42:10 +0200 Original-Received: from localhost ([::1]:35276 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mRmmO-00029J-Os for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 18 Sep 2021 22:42:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46296) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mRmmI-000296-Bv for bug-gnu-emacs@gnu.org; Sat, 18 Sep 2021 22:42:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53926) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mRmmI-0001uz-4z for bug-gnu-emacs@gnu.org; Sat, 18 Sep 2021 22:42:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mRmmI-0005DS-0P for bug-gnu-emacs@gnu.org; Sat, 18 Sep 2021 22:42:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael-David Fiszer Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 19 Sep 2021 02:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 50669 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.163201931620037 (code B ref -1); Sun, 19 Sep 2021 02:42:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 Sep 2021 02:41:56 +0000 Original-Received: from localhost ([127.0.0.1]:37239 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mRmmC-0005D7-1h for submit@debbugs.gnu.org; Sat, 18 Sep 2021 22:41:56 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:54484) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mRklE-0002ET-SK for submit@debbugs.gnu.org; Sat, 18 Sep 2021 20:32:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34300) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mRklE-0001ye-Jl for bug-gnu-emacs@gnu.org; Sat, 18 Sep 2021 20:32:48 -0400 Original-Received: from mail-vs1-xe30.google.com ([2607:f8b0:4864:20::e30]:44574) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mRklB-0006q9-5p for bug-gnu-emacs@gnu.org; Sat, 18 Sep 2021 20:32:47 -0400 Original-Received: by mail-vs1-xe30.google.com with SMTP id c28so13062763vsh.11 for ; Sat, 18 Sep 2021 17:32:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=xxtcpmCFyjWUu9CyIvxn1vggsiHvTaxSdjXgWJkrl+k=; b=nbvKRgLGFWW89/RbKdGJaM9bho3xc3VW+di1xM6zB2goOBo0ruNGovdSrIxXL4PtXe ypPnsOthKPN3reg5kjPPRCJDHjHyGrZi07radsl+5R3HsePJe2bcLUjt/yIX8BPcT3/1 8uHfEoa63vbSURJBAT30AKlmg9aJs3f4tsj8FANClx9yohenbMQHv8QXf/v9j2KJbRex UK7jbXLZ399JHhoSbhGx529s48ELzX5L+3cjFx2w5dKfiA8vt/ueQvRZwnnuf0bN9A9p HfDm7JxLPNGSpBY2HlEFlUMiH/VcmqzvaV9Bg2Xf7qCK92ST/q33NfmVViK4QwTnWVL6 pVJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=xxtcpmCFyjWUu9CyIvxn1vggsiHvTaxSdjXgWJkrl+k=; b=CQ7uizxKaWc4GuIFS0eWKI/4fxi7oGYRC6va9/xAH3bdUCJ7HObUewP8Mhp86uyHey xIkwdzvIDJwBXEyw4bCjjNtjLTZb7Z/iVuBBUSARwai80gQsPrBaRV4bRwfdNXgXk4u6 KNLs4VLXYdby/S/y/O3u7L8e39b/RKMvx4OVocxyb7InIfrGlH4dsFzcLJEKiZFI4fSA KV8/3yheNFJE5R2ZXFksTEJX2/z+dQD/mHkyW0diqJzHKby03NcOS/dEsBkg8WDiyiVC UYHROodi0WXhn4EGwIqoC9qJUPzRJyznG7l8/g8GF/w+1O98+UjWKUBEw6o6gHl6mbNZ Cs/Q== X-Gm-Message-State: AOAM530mEEnOCN/AnlbjerTb4qCWr5EzzLnBR5qOMoMmXYcWNx/Q0Zer kMsvk2iVbtUf4BoHQsw0gqxK8uhOUkn30r4Jjf0G1aogL9Y= X-Google-Smtp-Source: ABdhPJwbYSqhorSin3dv47nqR7+9yAq1TY66D64kbLOHswrfGA2rfVexleQEGM5azrSU6xX9ZljvvlT5lSqHPJWBW/s= X-Received: by 2002:a67:32c2:: with SMTP id y185mr1565529vsy.21.1632011561930; Sat, 18 Sep 2021 17:32:41 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::e30; envelope-from=sguibor@gmail.com; helo=mail-vs1-xe30.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 18 Sep 2021 22:41:54 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:214675 Archived-At: --0000000000006b175305cc4e4dd8 Content-Type: text/plain; charset="UTF-8" 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@28/28.0.50/share/info/emacs --prefix=/usr/local/Cellar/emacs-plus@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)) --0000000000006b175305cc4e4dd8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

I'm not an expert in how python.el internal= s work, but I started getting this error every time I would send a statemen= t to the shell. In addition I would get these weird printouts of blocks of = the form

```
=C2=A0 def __PYDOC_get_help(obj):
=C2=A0 =C2=A0 t= ry:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 import inspect
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 try:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 str_type =3D bases= tring
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 argspec_function =3D ins= pect.getargspec
=C2=A0 =C2=A0 =C2=A0 =C2=A0 except NameError:
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 str_type =3D 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 &optio= nal process msg)
=C2=A0 "Send STRING to inferior Python PROCESS.When optional argument MSG is non-nil, forces display of a
user-friendl= y message if there's no process running; defaults to
t when called i= nteractively."
=C2=A0 (interactive
=C2=A0 =C2=A0(list (read-stri= ng "Python command: ") nil t))
=C2=A0 (let ((process (or proce= ss (python-shell-get-process-or-error msg))))
=C2=A0 =C2=A0 (if (string-= match ".\n+." string) =C2=A0 ;Multiline.
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 (let* ((temp-file-name (python-shell--save-temp-file string))
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(file-name (or (buffer-= file-name) temp-file-name)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (python-= shell-send-file file-name process temp-file-name t))
=C2=A0 =C2=A0 =C2= =A0 (when (or (not (string-match "\n\\'" string))
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (string-match "\n[ \t= ].*\n?\\'" string))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (comint-send-st= ring 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))
= =C2=A0of 2021-09-17 built on mdfz-macbookpro4.roam.corp.google.com
Windowing system di= stributor 'Apple', version 10.3.2022
System Description: =C2=A0m= acOS 11.6

Configured using:
=C2=A0'configure --disable-depend= ency-tracking --disable-silent-rules
=C2=A0--enable-locallisppath=3D/usr= /local/share/emacs/site-lisp
=C2=A0--infodir=3D/usr/local/Cellar/emacs-p= lus@28/28.0.50/share/info/emacs
=C2=A0--prefix=3D/usr/local/Cellar/emacs= -plus@28/28.0.50 --with-xml2 --with-gnutls
=C2=A0--without-dbus --with-i= magemagick --with-modules --with-rsvg --with-ns
=C2=A0--disable-ns-self-= contained'

Configured features:
ACL GLIB GMP GNUTLS IMAGEMAGI= CK JPEG JSON LCMS2 LIBXML2 MODULES NOTIFY KQUEUE NS
PDUMPER PNG RSVG THR= EADS TIFF TOOLKIT_SCROLL_BARS XIM ZLIB

Important settings:
=C2=A0= value of $LC_ALL: en_US.UTF-8
=C2=A0 value of $LC_CTYPE: en_US.UTF-8=C2=A0 value of $LANG: en_US.UTF-8
=C2=A0 locale-coding-system: utf-8-u= nix

Major mode: mu4e-headers

Memory information:
((conses = 16 1905022 1639005)
=C2=A0(symbols 48 123242 97)
=C2=A0(strings 32 43= 3582 151543)
=C2=A0(string-bytes 1 14825386)
=C2=A0(vectors 16 192606= )
=C2=A0(vector-slots 8 3165377 831342)
=C2=A0(floats 8 1100 6586)=C2=A0(intervals 56 34684 19693)
=C2=A0(buffers 992 60))
--0000000000006b175305cc4e4dd8--