From unknown Thu Jun 19 14:05:09 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#50057 <50057@debbugs.gnu.org> To: bug#50057 <50057@debbugs.gnu.org> Subject: Status: 27.2; Issue evaluating Python code across machines Reply-To: bug#50057 <50057@debbugs.gnu.org> Date: Thu, 19 Jun 2025 21:05:09 +0000 retitle 50057 27.2; Issue evaluating Python code across machines reassign 50057 emacs submitter 50057 Augusto Stoffel severity 50057 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 14 12:01:40 2021 Received: (at submit) by debbugs.gnu.org; 14 Aug 2021 16:01:40 +0000 Received: from localhost ([127.0.0.1]:45296 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEw6O-0005Jo-5b for submit@debbugs.gnu.org; Sat, 14 Aug 2021 12:01:40 -0400 Received: from lists.gnu.org ([209.51.188.17]:40822) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEw6K-0005Jf-UC for submit@debbugs.gnu.org; Sat, 14 Aug 2021 12:01:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33970) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mEw6J-0008UF-VA for bug-gnu-emacs@gnu.org; Sat, 14 Aug 2021 12:01:36 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:42768) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mEw6I-0006R2-5D for bug-gnu-emacs@gnu.org; Sat, 14 Aug 2021 12:01:35 -0400 Received: by mail-wr1-x42a.google.com with SMTP id q11so17432498wrr.9 for ; Sat, 14 Aug 2021 09:01:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=I29RTPwpn9vbyia3di+j2Hxjf+kG2AHbZbX35VRQRE4=; b=mlSitQiMhaY/wC7KRSv93CZxnrpxvjdpDiaoZIP5tkw1MrAovcv52jRFS+TkBtbDKs aejPJVO6mrOYerPnrx1KbIiev1MURLRopf9EvunV5MqMtvsqWHo+ATz86uytKkYwFdfU XdMpeozQBpvsD5uxv3MpAr8na/4u7suqddO6UgxspkXQFXzPX9wN9++jS+iyoflb7nCE qZXrC/K4mS27HNi8RBzkiu6BIHdQ7J558FteQ1eu38bYNYv/ES3FmnksqijluDM5DJT8 qI3ZJueDEK79WXesAS7fTR6N1mk1sBsGFfIdTvW0R2Bh9EMbvK8JfnBvV5WeujHALDLd A+ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=I29RTPwpn9vbyia3di+j2Hxjf+kG2AHbZbX35VRQRE4=; b=ps0Pp4YfmoQ/6EbXa+jMebdCN5myOKqNqGzs3lhpppNX5gkeyA3DEMXTsuC6DHDksR nVOqHyVuZVE9u5xOWo5eqMq9n2P8/CjL7mP33819T3/Mx5Ws703pB5LJXzMEZRrKZmE8 DiM4/ZQowC+CenTXFukEhT1ThqG3EnJpX5lFWwmSmOBiIOzMMWI8tJtcUXwLpNTvSc/9 fM19ZrpmQCbVsdyX1i9jj6MLVNUQXBt80Wb7c7sw6pRK0UWgJjZ7B4HTTZ5AwhszszKb ZIwbkz9tt73RdWI3GWGvvfKTbJcOj3BX0/LFbloQoaWRCp9eTBy7/eRaFzKs1grwqJJ7 00jw== X-Gm-Message-State: AOAM5335LkoU1sTQ81Lx9t0/dIfvjpo51XePWdFHuM8P1fo+9AWYQSok Ii7lWgP2EEf64zgaXuvuoyian4oTE0Y= X-Google-Smtp-Source: ABdhPJwYPYc5X/zsbDELRBnPA32AGas7WqhOXrfKMut5atnW0pkAD9e5j7fVBC8B9JK94Av+bLer3Q== X-Received: by 2002:adf:e887:: with SMTP id d7mr8720541wrm.79.1628956890629; Sat, 14 Aug 2021 09:01:30 -0700 (PDT) Received: from ars3 ([2a02:8109:8ac0:56d0::ae3f]) by smtp.gmail.com with ESMTPSA id i14sm4510848wmq.40.2021.08.14.09.01.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Aug 2021 09:01:30 -0700 (PDT) From: Augusto Stoffel To: bug-gnu-emacs@gnu.org Subject: 27.2; Issue evaluating Python code across machines Date: Sat, 14 Aug 2021 18:01:28 +0200 Message-ID: <8735rcc8x3.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=arstoffel@gmail.com; helo=mail-wr1-x42a.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, 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-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain Suppose the current buffer is editing a local file and you would like to evaluate some code on a Python inferior running in a remote machine. The following should work: (let ((default-directory "/ssh:some-remote-machine:/")) (run-python)) (python-shell-send-string "5+5") (python-shell-send-string "(5\n+5)") The first python-shell-send-string call indeed works. The second one produces an error, because a temporary file is created in the local machine instead of the remote one. The same kind of error happens if one tries to evaluate the region on the entire buffer. I've attached a small patch to fix this. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Allow-evaluating-Python-code-across-machines.patch >From b3f47f99da7b8ac2221b6bbafc85ae8076f92703 Mon Sep 17 00:00:00 2001 From: Augusto Stoffel Date: Sat, 14 Aug 2021 17:48:45 +0200 Subject: [PATCH] Allow evaluating Python code across machines * python.el (python-shell-send-string): Ensure that the temporary file is created in the host running the Python process. --- lisp/progmodes/python.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 2557704e40..20299c20d2 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -3085,7 +3085,8 @@ python-shell-send-string (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)) + (let* ((temp-file-name (with-current-buffer (process-buffer process) + (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)) (comint-send-string process string) -- 2.31.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 15 08:01:19 2021 Received: (at 50057) by debbugs.gnu.org; 15 Aug 2021 12:01:19 +0000 Received: from localhost ([127.0.0.1]:45936 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFEpL-0000Bm-Ad for submit@debbugs.gnu.org; Sun, 15 Aug 2021 08:01:19 -0400 Received: from quimby.gnus.org ([95.216.78.240]:58150) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFEpJ-0000BW-Tm for 50057@debbugs.gnu.org; Sun, 15 Aug 2021 08:01:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=PkzgvEkiu4IUtVwicdzWzxintC3udFB+vLWFS+wramo=; b=LlYk+Fvm0cdKgm7S8w9fmipQrw LskGi3S23ssgYoKxFiNH7xFvXU8nlSYHCxCguo0LtyQxDxX6ztItxo+wEWB51zJip9a9vGHECoi3f 6dhN4UNTnH4yiMei+4msoFqwcVAqqTKTuFFne0b1lXxAb49Mp0t2c4OYl/BFCa2+lHoc=; Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mFEp9-0008LA-Mn; Sun, 15 Aug 2021 14:01:11 +0200 From: Lars Ingebrigtsen To: Augusto Stoffel Subject: Re: bug#50057: 27.2; Issue evaluating Python code across machines References: <8735rcc8x3.fsf@gmail.com> Date: Sun, 15 Aug 2021 14:01:07 +0200 In-Reply-To: <8735rcc8x3.fsf@gmail.com> (Augusto Stoffel's message of "Sat, 14 Aug 2021 18:01:28 +0200") Message-ID: <87pmueor24.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Augusto Stoffel writes: > The first python-shell-send-string call indeed works. The second one > produces an error, because a temporary file is created in the local > machine instead of the remote one. The same kind of error [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50057 Cc: 50057@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Augusto Stoffel writes: > The first python-shell-send-string call indeed works. The second one > produces an error, because a temporary file is created in the local > machine instead of the remote one. The same kind of error happens if > one tries to evaluate the region on the entire buffer. > > I've attached a small patch to fix this. Thanks; applied to Emacs 28. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 15 08:01:26 2021 Received: (at control) by debbugs.gnu.org; 15 Aug 2021 12:01:26 +0000 Received: from localhost ([127.0.0.1]:45939 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFEpS-0000C8-HE for submit@debbugs.gnu.org; Sun, 15 Aug 2021 08:01:26 -0400 Received: from quimby.gnus.org ([95.216.78.240]:58166) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFEpQ-0000Bn-HC for control@debbugs.gnu.org; Sun, 15 Aug 2021 08:01:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=5k0497YrWRH6e48xu0PvGYT5ARF5c8KYI24F1vYocu4=; b=rmESbVMaBUNWazp/J6UzEF7bzP u3rMnA6F4tihC2etB0VlbAgzOItm4YzVW54FHd8fj2r1t1YHfuetSilJH3ynBevPxHtgHyeMOZxNy 9IZnzpWGYE51x96nTJQnksjYTS83kaSTErGd1DgAxQoXRllFodfF6h83UOkCsheUEWmA=; Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mFEpI-0008LI-LW for control@debbugs.gnu.org; Sun, 15 Aug 2021 14:01:18 +0200 Date: Sun, 15 Aug 2021 14:01:16 +0200 Message-Id: <87o89yor1v.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #50057 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 50057 28.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) close 50057 28.1 quit From unknown Thu Jun 19 14:05:09 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 13 Sep 2021 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator