From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Augusto Stoffel 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 11:10:00 +0200 Message-ID: <87zgs9gcd3.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13008"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 50669@debbugs.gnu.org To: Michael-David Fiszer Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 19 11:11:15 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 1mRsqx-0003Hf-2q for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 19 Sep 2021 11:11:15 +0200 Original-Received: from localhost ([::1]:59058 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mRsqw-0003y9-0L for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 19 Sep 2021 05:11:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51428) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mRsqk-0003xj-NM for bug-gnu-emacs@gnu.org; Sun, 19 Sep 2021 05:11:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54141) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mRsqk-0001UD-FR for bug-gnu-emacs@gnu.org; Sun, 19 Sep 2021 05:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mRsqk-0006za-8K for bug-gnu-emacs@gnu.org; Sun, 19 Sep 2021 05:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Augusto Stoffel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 19 Sep 2021 09:11: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.163204261026811 (code B ref 50669); Sun, 19 Sep 2021 09:11:02 +0000 Original-Received: (at 50669) by debbugs.gnu.org; 19 Sep 2021 09:10:10 +0000 Original-Received: from localhost ([127.0.0.1]:37454 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mRspu-0006yN-5K for submit@debbugs.gnu.org; Sun, 19 Sep 2021 05:10:10 -0400 Original-Received: from mail-ed1-f49.google.com ([209.85.208.49]:33484) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mRsps-0006y5-Ha for 50669@debbugs.gnu.org; Sun, 19 Sep 2021 05:10:08 -0400 Original-Received: by mail-ed1-f49.google.com with SMTP id c21so47911239edj.0 for <50669@debbugs.gnu.org>; Sun, 19 Sep 2021 02:10:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=HRc96u0ZQRRCofg4BiWlS2LxdB/KSTDiAcjnCq/Ksh0=; b=k1mtSqL8+zOcUFRoehybvBExYFo3/N0N2H4aDOvD8upgh4Z67o6u22vf8XG0ln0z6T vCtwDXt0UFlZrAU+Ce3RSXnoLwwIDDbf3dfGcPdQr15yiQ2Jrw3qwLDw9fclYUl67jVv Qsu/03wlXgz21geSaX4kWTbNc6NFPZFQJWz5wE+kLYwlnSHRP+UgCVSV4u2TrRgg1+qg Cm1sKKCQdqOe9gVn7pXsoLpSmthL57b3ZhGdKhKMMozKvM8IJUXgW+mk1KLKEyKyNZ6n CLMmS/zufabHydTwISWJLiP3GRBKCa+RAj1uI3Y/qiGAUxcbxjp83VwDtRvdw8ioxjW4 HShQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=HRc96u0ZQRRCofg4BiWlS2LxdB/KSTDiAcjnCq/Ksh0=; b=shmi0iM7CXC7jmimnuO4We++7//wryuVlKf0vvdwHoF5kcKHMf3xRvKw5GQTC8YCV3 WqIWzJespUpIHrYii/LCzhL6MdMESLba/bT3n/lzSKGcqkFOElkX4htKd38v/GB4pWB+ MpowdMVhTgrIqJEKlPSil2aVbs1GsJaI9wygHj0lXu5+8JIhKZSa7C9qcEHPJ5M2OqEv CjryAjTGVROHFS6o1hJQzyRjmLPKr3aOk71he3nIPR4WDOIzeUFidEqY5srl5V6WXqDQ icLUwCWOI/j5V1rAndIarHn6k55tToKg5ZfZ3cbkwfQq9VFPvqffHaWsXTFGLS/q56r8 aZzQ== X-Gm-Message-State: AOAM533qv+HdjkMy97M2Zx9NfzpTFqjpqhcH6X+thNRH4BIQsPJWaWMD hlRfR9HyPc/klfkj+eZQbUXVSSZ3Qsg= X-Google-Smtp-Source: ABdhPJwWVdv48IVLa7ic/lYtxxwjaffC7F0XZMxX0UpiGIf47JhHWYoXEukaGynqw/HdLryCoJXzlg== X-Received: by 2002:a17:906:5f96:: with SMTP id a22mr9721793eju.58.1632042602422; Sun, 19 Sep 2021 02:10:02 -0700 (PDT) Original-Received: from ars3 ([2a02:8109:8ac0:56d0::2f72]) by smtp.gmail.com with ESMTPSA id by26sm5301333edb.69.2021.09.19.02.10.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Sep 2021 02:10:02 -0700 (PDT) In-Reply-To: (Michael-David Fiszer's message of "Sun, 19 Sep 2021 03:32:30 +0300") 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:214692 Archived-At: On Sun, 19 Sep 2021 at 03:32, Michael-David Fiszer wrote: > Hi, Hi, Can you try 'M-x toggle-debug-on-error', or maybe tracing some functions, to discover what is being called repeatedly? Also, what happens if you (setq python-eldoc-get-doc nil) in the .py file's buffer? Some more macos-related things that would be helpful to know: * On a freshly started python-shell, is are the functions __PYTHON_EL_eval and __PYTHON_EL_eval_file defined? * If you do M-x python-shell-send-string RET x="aaa...aaa" or something like that, can you evaluate Python statements that are, say, 900 and 1100 characters long? > > 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))