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 12:52:26 +0300 Message-ID: References: <87zgs9gcd3.fsf@gmail.com> <87v92whpen.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000e0514605cc561f80" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4111"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 50669@debbugs.gnu.org To: Augusto Stoffel Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 19 11:53:13 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 1mRtVY-0000qD-1G for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 19 Sep 2021 11:53:12 +0200 Original-Received: from localhost ([::1]:35698 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mRtVV-0000f2-OX for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 19 Sep 2021 05:53:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54574) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mRtVO-0000ep-Jz for bug-gnu-emacs@gnu.org; Sun, 19 Sep 2021 05:53:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54169) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mRtVO-0003RC-BI for bug-gnu-emacs@gnu.org; Sun, 19 Sep 2021 05:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mRtVO-00085V-8W for bug-gnu-emacs@gnu.org; Sun, 19 Sep 2021 05:53: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 09:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50669 X-GNU-PR-Package: emacs Original-Received: via spool by 50669-submit@debbugs.gnu.org id=B50669.163204516731064 (code B ref 50669); Sun, 19 Sep 2021 09:53:02 +0000 Original-Received: (at 50669) by debbugs.gnu.org; 19 Sep 2021 09:52:47 +0000 Original-Received: from localhost ([127.0.0.1]:37482 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mRtV8-00084y-JU for submit@debbugs.gnu.org; Sun, 19 Sep 2021 05:52:47 -0400 Original-Received: from mail-vk1-f174.google.com ([209.85.221.174]:39898) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mRtV5-00084h-Jx for 50669@debbugs.gnu.org; Sun, 19 Sep 2021 05:52:45 -0400 Original-Received: by mail-vk1-f174.google.com with SMTP id f73so3616265vkf.6 for <50669@debbugs.gnu.org>; Sun, 19 Sep 2021 02:52:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=TgAfmfEJd5hhg2WtLsfRMl3rL2XuadCvEJVl/7Z5WXs=; b=MbGYHWVGsbJ3ef1gSST3TlFFBySMYmixY+VJAsiQvgsFcyWr9Q15dAkJQ/QpxaplMQ y/Vz8h9Zy/iLeYa+LVB65TI5v7mc8S/5wVsAQeXRggP1WL3pLeK5zvtD/3knPRoQuO1V TxA7XFC/fhP2+zj4PSEuqAUhfZIqEGOaAprarRDR5cVhF1u6H6QsRhmv52i/bHQileVK eWsfnU7ct+KpcJRBHzowmnoEhNqI92JjENz9bJMlBv7W4U9DM8LykqyLGclPVnLhHMFZ PksJybA1CYKpMnXnkrkhWqAqcUKm7q7I/DOTSkWTocMseNC33tbxyU3L2U/+/DpYqa2e WBTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TgAfmfEJd5hhg2WtLsfRMl3rL2XuadCvEJVl/7Z5WXs=; b=nzHpWBV56xClTuZkkfDTI/34cu6GIVWHhgVczWVcstaJLVQKpe+Z8F8HqmOR7rsMS5 wEdS/JZ8LsV9CZjiFKP1F9KzaY52vJOW+1t2nBDAKlqbkG9nkruCoiOLSlXfr23KepZI AIrOfJ9dQ0x/6h9HWZCqDZbN/nE3T5CWogKJA3K4Iv1ctvJyf9b5x/BeTYQKVxGCVzz5 3hJJk2tgdVDy0BJCsxOMl6hqVTS/97ZxijKveJRttLxqEv999eq0lYOkCrW3mIP5eV36 4W5bdLtMlevB0DiLh1WRqmo2zfkgYSKqtd0k3RjEESo3mdTuugPDkM8p8BXFsvUUB19t TPxg== X-Gm-Message-State: AOAM530Lvr8vN84nVWx9XzRQ+tOPJOZYWOD0lgPE2YxRhjNWuEBJzZBC LHmwGRsA36K/f8/dPRUgqCpg8sz2w6npTWCEl8VV0xDT5QQ= X-Google-Smtp-Source: ABdhPJzi9nJe+xnm+yAwJatWXxszuPI2j58thiMPOCVQ1bb5G5naAumN7cOR2q+Se3CIE+/bwr//p3a0r4IMZRVc7M4= X-Received: by 2002:a1f:d943:: with SMTP id q64mr12424045vkg.23.1632045157600; Sun, 19 Sep 2021 02:52:37 -0700 (PDT) In-Reply-To: <87v92whpen.fsf@gmail.com> 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:214696 Archived-At: --000000000000e0514605cc561f80 Content-Type: text/plain; charset="UTF-8" You are right. They are not calling one another (python-shell-send-file calls comint). I think that it may that something is making them be called one after another (my bad). Backtrace looks like this (I changed the file name to `a_file_name` since it's a company path) string-match-p("magit-.*: .*" "rider_now_utils.py") (not (string-match-p useless-regexp buf-name)) (setq --cl-flag-- (not (string-match-p useless-regexp buf-name))) (progn (setq useless-regexp (car --cl-var--)) (setq --cl-flag-- (not (string-match-p useless-regexp buf-name)))) (and (consp --cl-var--) (progn (setq useless-regexp (car --cl-var--)) (setq --cl-flag-- (not (string-match-p useless-regexp buf-name))))) (while (and (consp --cl-var--) (progn (setq useless-regexp (car --cl-var--)) (setq --cl-flag-- (not (string-match-p useless-regexp buf-name))))) (setq --cl-var-- (cdr --cl-var--))) (let* ((--cl-var-- spacemacs-useless-buffers-regexp) (useless-regexp nil) (--cl-flag-- t)) (while (and (consp --cl-var--) (progn (setq useless-regexp (car --cl-var--)) (setq --cl-flag-- (not (string-match-p useless-regexp buf-name))))) (setq --cl-var-- (cdr --cl-var--))) (if --cl-flag-- (progn t) nil)) (or (provided-mode-derived-p (buffer-local-value 'major-mode buffer) 'comint-mode) (let* ((--cl-var-- spacemacs-useful-buffers-regexp) (useful-regexp nil) (--cl-flag-- t) --cl-var--) (while (and (consp --cl-var--) (progn (setq useful-regexp (car --cl-var--)) (setq --cl-flag-- (not (setq --cl-var-- ...))))) (setq --cl-var-- (cdr --cl-var--))) --cl-var--) (let* ((--cl-var-- spacemacs-useless-buffers-regexp) (useless-regexp nil) (--cl-flag-- t)) (while (and (consp --cl-var--) (progn (setq useless-regexp (car --cl-var--)) (setq --cl-flag-- (not (string-match-p useless-regexp buf-name))))) (setq --cl-var-- (cdr --cl-var--))) (if --cl-flag-- (progn t) nil))) (let ((buf-name (buffer-name buffer))) (or (provided-mode-derived-p (buffer-local-value 'major-mode buffer) 'comint-mode) (let* ((--cl-var-- spacemacs-useful-buffers-regexp) (useful-regexp nil) (--cl-flag-- t) --cl-var--) (while (and (consp --cl-var--) (progn (setq useful-regexp (car --cl-var--)) (setq --cl-flag-- (not ...)))) (setq --cl-var-- (cdr --cl-var--))) --cl-var--) (let* ((--cl-var-- spacemacs-useless-buffers-regexp) (useless-regexp nil) (--cl-flag-- t)) (while (and (consp --cl-var--) (progn (setq useless-regexp (car --cl-var--)) (setq --cl-flag-- (not ...)))) (setq --cl-var-- (cdr --cl-var--))) (if --cl-flag-- (progn t) nil)))) spacemacs/useful-buffer-p(#) kill-buffer(#) #f(compiled-function () #)() python-shell-send-file("a_file_name..." # "/var/folders/gx/6fqj2t4x5tn4zml2qp9__9mr00j58f/T/p..." t) #f(compiled-function (string &optional process msg) "Send STRING to inferior Python PROCESS.\nWhen optional argument MSG is non-nil, forces display of a\nuser-friendly message if there's no process running; defaults to\nt when called interactively." (interactive #f(compiled-function () #)) #)("import sys, codecs, os, ast;__pyfile = codecs.open..." #) apply(#f(compiled-function (string &optional process msg) "Send STRING to inferior Python PROCESS.\nWhen optional argument MSG is non-nil, forces display of a\nuser-friendly message if there's no process running; defaults to\nt when called interactively." (interactive #f(compiled-function () #)) #) ("import sys, codecs, os, ast;__pyfile = codecs.open..." #)) python-shell-send-string("import sys, codecs, os, ast;__pyfile = codecs.open..." #) python-shell-send-file("a_file_name..." # "/var/folders/gx/6fqj2t4x5tn4zml2qp9__9mr00j58f/T/p..." t) #f(compiled-function (string &optional process msg) "Send STRING to inferior Python PROCESS.\nWhen optional argument MSG is non-nil, forces display of a\nuser-friendly message if there's no process running; defaults to\nt when called interactively." (interactive #f(compiled-function () #)) #)("import sys, codecs, os, ast;__pyfile = codecs.open..." #) apply(#f(compiled-function (string &optional process msg) "Send STRING to inferior Python PROCESS.\nWhen optional argument MSG is non-nil, forces display of a\nuser-friendly message if there's no process running; defaults to\nt when called interactively." (interactive #f(compiled-function () #)) #) ("import sys, codecs, os, ast;__pyfile = codecs.open..." #)) python-shell-send-string("import sys, codecs, os, ast;__pyfile = codecs.open..." #) python-shell-send-file("a_file_name..." # "/var/folders/gx/6fqj2t4x5tn4zml2qp9__9mr00j58f/T/p..." t) #f(compiled-function (string &optional process msg) "Send STRING to inferior Python PROCESS.\nWhen optional argument MSG is non-nil, forces display of a\nuser-friendly message if there's no process running; defaults to\nt when called interactively." (interactive #f(compiled-function () #)) #)("import sys, codecs, os, ast;__pyfile = codecs.open..." #) apply(#f(compiled-function (string &optional process msg) "Send STRING to inferior Python PROCESS.\nWhen optional argument MSG is non-nil, forces display of a\nuser-friendly message if there's no process running; defaults to\nt when called interactively." (interactive #f(compiled-function () #)) #) ("import sys, codecs, os, ast;__pyfile = codecs.open..." #)) python-shell-send-string("import sys, codecs, os, ast;__pyfile = codecs.open..." #) python-shell-send-file("a_file_name..." # "/var/folders/gx/6fqj2t4x5tn4zml2qp9__9mr00j58f/T/p..." t) On Sun, Sep 19, 2021 at 12:42 PM Augusto Stoffel wrote: > On Sun, 19 Sep 2021 at 12:28, Michael-David Fiszer > wrote: > > > Hi! > > > > Thanks for the response! > > > > I'll fill in the details shortly. I wanted to add to the bug, that the > functions being called repeatedly > > were `python-shell-send-string` and `python-shell-send-file`. > > > > They call one another and create more and more temporary files before I > get the recursion error. > > > > Are you on the current master? These two functions used to be > entangled, but now only -send-string calls -send-file. > --000000000000e0514605cc561f80 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
You are right. They are not calling one another (python-sh= ell-send-file calls comint). I think that it may that something is making t= hem be called one after another (my bad).

Bac= ktrace looks like this (I changed the file name to `a_file_name` since it&#= 39;s a company path)

=C2=A0 string-match-p("m= agit-.*: .*" "rider_now_utils.py")
=C2=A0 (not (string-ma= tch-p useless-regexp buf-name))
=C2=A0 (setq --cl-flag-- (not (string-ma= tch-p useless-regexp buf-name)))
=C2=A0 (progn (setq useless-regexp (car= --cl-var--)) (setq --cl-flag-- (not (string-match-p useless-regexp buf-nam= e))))
=C2=A0 (and (consp --cl-var--) (progn (setq useless-regexp (car --= cl-var--)) (setq --cl-flag-- (not (string-match-p useless-regexp buf-name))= )))
=C2=A0 (while (and (consp --cl-var--) (progn (setq useless-regexp (c= ar --cl-var--)) (setq --cl-flag-- (not (string-match-p useless-regexp buf-n= ame))))) (setq --cl-var-- (cdr --cl-var--)))
=C2=A0 (let* ((--cl-var-- s= pacemacs-useless-buffers-regexp) (useless-regexp nil) (--cl-flag-- t)) (whi= le (and (consp --cl-var--) (progn (setq useless-regexp (car --cl-var--)) (s= etq --cl-flag-- (not (string-match-p useless-regexp buf-name))))) (setq --c= l-var-- (cdr --cl-var--))) (if --cl-flag-- (progn t) nil))
=C2=A0 (or (p= rovided-mode-derived-p (buffer-local-value 'major-mode buffer) 'com= int-mode) (let* ((--cl-var-- spacemacs-useful-buffers-regexp) (useful-regex= p nil) (--cl-flag-- t) --cl-var--) (while (and (consp --cl-var--) (progn (s= etq useful-regexp (car --cl-var--)) (setq --cl-flag-- (not (setq --cl-var--= ...))))) (setq --cl-var-- (cdr --cl-var--))) --cl-var--) (let* ((--cl-var-= - spacemacs-useless-buffers-regexp) (useless-regexp nil) (--cl-flag-- t)) (= while (and (consp --cl-var--) (progn (setq useless-regexp (car --cl-var--))= (setq --cl-flag-- (not (string-match-p useless-regexp buf-name))))) (setq = --cl-var-- (cdr --cl-var--))) (if --cl-flag-- (progn t) nil)))
=C2=A0 (l= et ((buf-name (buffer-name buffer))) (or (provided-mode-derived-p (buffer-l= ocal-value 'major-mode buffer) 'comint-mode) (let* ((--cl-var-- spa= cemacs-useful-buffers-regexp) (useful-regexp nil) (--cl-flag-- t) --cl-var-= -) (while (and (consp --cl-var--) (progn (setq useful-regexp (car --cl-var-= -)) (setq --cl-flag-- (not ...)))) (setq --cl-var-- (cdr --cl-var--))) --cl= -var--) (let* ((--cl-var-- spacemacs-useless-buffers-regexp) (useless-regex= p nil) (--cl-flag-- t)) (while (and (consp --cl-var--) (progn (setq useless= -regexp (car --cl-var--)) (setq --cl-flag-- (not ...)))) (setq --cl-var-- (= cdr --cl-var--))) (if --cl-flag-- (progn t) nil))))
=C2=A0 spacemacs/use= ful-buffer-p(#<buffer rider_now_utils.py>)
=C2=A0 kill-buffer(#<= ;buffer =C2=A0*temp*-957895>)
=C2=A0 #f(compiled-function () #<byt= ecode -0x1c1e1505371ddc2b>)()
=C2=A0 python-shell-send-file("a_f= ile_name..." #<process Python> "/var/folders/gx/6fqj2t4x5tn= 4zml2qp9__9mr00j58f/T/p..." t)
=C2=A0 #f(compiled-function (string = &optional process msg) "Send STRING to inferior Python PROCESS.\nW= hen optional argument MSG is non-nil, forces display of a\nuser-friendly me= ssage if there's no process running; defaults to\nt when called interac= tively." (interactive #f(compiled-function () #<bytecode 0x14ff04c7= 03dd2bc5>)) #<bytecode -0x168dce9d6e1d8f8e>)("import sys, cod= ecs, os, ast;__pyfile =3D codecs.open..." #<process Python>)
= =C2=A0 apply(#f(compiled-function (string &optional process msg) "= Send STRING to inferior Python PROCESS.\nWhen optional argument MSG is non-= nil, forces display of a\nuser-friendly message if there's no process r= unning; defaults to\nt when called interactively." (interactive #f(com= piled-function () #<bytecode 0x14ff04c703dd2bc5>)) #<bytecode -0x1= 68dce9d6e1d8f8e>) ("import sys, codecs, os, ast;__pyfile =3D codecs= .open..." #<process Python>))
=C2=A0 python-shell-send-string= ("import sys, codecs, os, ast;__pyfile =3D codecs.open..." #<p= rocess Python>)
=C2=A0 python-shell-send-file("a_file_name...&qu= ot; #<process Python> "/var/folders/gx/6fqj2t4x5tn4zml2qp9__9mr0= 0j58f/T/p..." t)
=C2=A0 #f(compiled-function (string &optional = process msg) "Send STRING to inferior Python PROCESS.\nWhen optional a= rgument MSG is non-nil, forces display of a\nuser-friendly message if there= 's no process running; defaults to\nt when called interactively." = (interactive #f(compiled-function () #<bytecode 0x14ff04c703dd2bc5>))= #<bytecode -0x168dce9d6e1d8f8e>)("import sys, codecs, os, ast;_= _pyfile =3D codecs.open..." #<process Python>)
=C2=A0 apply(#= f(compiled-function (string &optional process msg) "Send STRING to= inferior Python PROCESS.\nWhen optional argument MSG is non-nil, forces di= splay of a\nuser-friendly message if there's no process running; defaul= ts to\nt when called interactively." (interactive #f(compiled-function= () #<bytecode 0x14ff04c703dd2bc5>)) #<bytecode -0x168dce9d6e1d8f8= e>) ("import sys, codecs, os, ast;__pyfile =3D codecs.open..."= #<process Python>))
=C2=A0 python-shell-send-string("import = sys, codecs, os, ast;__pyfile =3D codecs.open..." #<process Python&= gt;)
=C2=A0 python-shell-send-file("a_file_name..." #<proce= ss Python> "/var/folders/gx/6fqj2t4x5tn4zml2qp9__9mr00j58f/T/p...&q= uot; t)
=C2=A0 #f(compiled-function (string &optional process msg) &= quot;Send STRING to inferior Python PROCESS.\nWhen optional argument MSG is= non-nil, forces display of a\nuser-friendly message if there's no proc= ess running; defaults to\nt when called interactively." (interactive #= f(compiled-function () #<bytecode 0x14ff04c703dd2bc5>)) #<bytecode= -0x168dce9d6e1d8f8e>)("import sys, codecs, os, ast;__pyfile =3D co= decs.open..." #<process Python>)
=C2=A0 apply(#f(compiled-fun= ction (string &optional process msg) "Send STRING to inferior Pyth= on PROCESS.\nWhen optional argument MSG is non-nil, forces display of a\nus= er-friendly message if there's no process running; defaults to\nt when = called interactively." (interactive #f(compiled-function () #<bytec= ode 0x14ff04c703dd2bc5>)) #<bytecode -0x168dce9d6e1d8f8e>) ("= import sys, codecs, os, ast;__pyfile =3D codecs.open..." #<process = Python>))
=C2=A0 python-shell-send-string("import sys, codecs, o= s, ast;__pyfile =3D codecs.open..." #<process Python>)
=C2=A0= python-shell-send-file("a_file_name..." #<process Python> = "/var/folders/gx/6fqj2t4x5tn4zml2qp9__9mr00j58f/T/p..." t)
=C2= =A0


On Sun, Sep 19, 2021 at 12:42 PM Augusto Stof= fel <arstoffel@gmail.com> = wrote:
On Sun, 1= 9 Sep 2021 at 12:28, Michael-David Fiszer <sguibor@gmail.com> wrote:

> Hi!
>
> Thanks for the response!
>
> I'll fill in the details shortly. I wanted to add to the bug, that= the functions being called repeatedly
> were `python-shell-send-string` and `python-shell-send-file`.
>
> They call one another and create more and more temporary files before = I get the recursion error.
>

Are you on the current master?=C2=A0 These two functions used to be
entangled, but now only -send-string calls -send-file.
--000000000000e0514605cc561f80--