From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id mMmnN/3QOl+fGAAA0tVLHw (envelope-from ) for ; Mon, 17 Aug 2020 18:48:29 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id sJ9yM/3QOl+hYwAAB5/wlQ (envelope-from ) for ; Mon, 17 Aug 2020 18:48:29 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 5576D940876 for ; Mon, 17 Aug 2020 18:48:24 +0000 (UTC) Received: from localhost ([::1]:43096 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k7kBD-0005hq-6L for larch@yhetil.org; Mon, 17 Aug 2020 14:48:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49058) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k7kAc-0005hg-I8 for emacs-orgmode@gnu.org; Mon, 17 Aug 2020 14:47:47 -0400 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:57471) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k7kAa-0006L8-Cz for emacs-orgmode@gnu.org; Mon, 17 Aug 2020 14:47:46 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 19633CBB for ; Mon, 17 Aug 2020 14:47:41 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Mon, 17 Aug 2020 14:47:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cvdub.net; h= from:to:subject:date:message-id:mime-version:content-type; s= fm2; bh=0reax/HkIYJIJYSGI7F/DSadDJZCeJYxbg6KPUE+z18=; b=jVeq9MEH WJ06I/Oi7m/PQda+FC0BleChcWEmtQFaOT6V1AihYgR9mA0YqS3qIuMoQgH4my7a aCgBnJRyptKwZkV9XqP3FhKGB4mu0y9FQs7AE0MIUcmbfv6ztBIhR4RFyGUjZvG4 pnvttlIa9S6InvPOotXGVhoTO+oRmhF2bp0bXtTID67+hb1RhQHv5qWHUwz5kqg4 ocVbkCZ/3t8n56hh/IGF1NcYExt1hk0k5FrH1+ZDwEcybw9T0/J3UKYtTYc58A+J 8VhklTuLANoDXQ54BeXZNUL9Wcic7/Gp1c9tOnc7K90Ojz3bAJm9MnA8YPFMvI72 6YV2pPYKBgjc4Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=0reax/HkIYJIJYSGI7F/DSadDJZCe JYxbg6KPUE+z18=; b=omr7xbZg8IGsCO47daoq5nkVVayclFniw3q0LCB6jHaTK FLagx+h54oqvgKGLMllRF0yGDL6s63cG3tFz0YgvUI9wTQPbibw6j2ympl+xTi10 uCJLWaihiJiDS3qUhLR3vDLYJ1XPD8SqHBr0LosOtCFRe6AuUCuG0LfUx7eIIWOB 2+fCwKagDxYRkRS/ONFs6dZux+Bw//i7BdYazafLi0wbHh1nag90znEwz8VBHQCc kSyySh5Uq+mIEuzy/J9DNThWHFtsaSgVbQ8bXYZtUaoj7ZTtOgaQZHKcmaHZETnY //KxFXWk794fZ87B6e5dnUFkHMz5g112E8vxFH6lA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedruddtgedgfeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkgggtsehmtderredttd dtnecuhfhrohhmpeevhhhrihhsthhirghnucggrghnuggvrhifrghllhcuoegthhhrihhs thhirghnsegtvhguuhgsrdhnvghtqeenucggtffrrghtthgvrhhnpeefveeiffekgeeife etffejveekuedvjeduteefteelheehvdelleelteetlefhheenucfkphepjeefrddutdel rdelkedruddunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homheptghhrhhishhtihgrnhestghvughusgdrnhgvth X-ME-Proxy: Received: from localhost (unknown [73.109.98.11]) by mail.messagingengine.com (Postfix) with ESMTPA id 55492328005A for ; Mon, 17 Aug 2020 14:47:40 -0400 (EDT) From: Christian Vanderwall To: emacs-orgmode@gnu.org Subject: [PATCH] ob-python.el: Fix issue with sessions on remote machines Date: Mon, 17 Aug 2020 11:47:38 -0700 Message-ID: <87h7t16red.fsf@pc.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=64.147.123.25; envelope-from=christian@cvdub.net; helo=wout2-smtp.messagingengine.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/17 14:47:41 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=cvdub.net header.s=fm2 header.b=jVeq9MEH; dkim=pass header.d=messagingengine.com header.s=fm3 header.b=omr7xbZg; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -1.21 X-TUID: FuqGFi6DmErR --=-=-= Content-Type: text/plain The function `org-babel-python-evaluate-session' doesn't process temp file names with `org-babel-process-file-name' before inserting them into the Python code blocks. This causes a 'No such file' error when the executing the code blocks on a remote directory. The attached patch fixes this issue, allowing compilation of Python source blocks with a remote directory, such as :dir /ssh:user@server:/. This is my first patch ever, so please let me know if there's ways I can improve. Thanks! -- Christian Vanderwall --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-ob-python.el-Fix-issue-with-sessions-on-remote-machi.patch >From 7cf3d4c53e12addced7d2f65de1632971f44f056 Mon Sep 17 00:00:00 2001 From: Christian Vanderwall Date: Tue, 11 Aug 2020 20:26:39 -0700 Subject: [PATCH] ob-python.el: Fix issue with sessions on remote machines * lisp/ob-python.el (org-babel-python-evaluate-session): Process temporary file name with `org-babel-process-file-name' before inserting it into code Python code snippets. Before this change, the entire temporary filename was sent to the Python session for execution, causing a 'No such file' error when the filename had a Tramp format such as /ssh:user@server:/tmp/python-ABCDEF. TINYCHANGE --- lisp/ob-python.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/ob-python.el b/lisp/ob-python.el index 69312f2c9..0e3c79522 100644 --- a/lisp/ob-python.el +++ b/lisp/ob-python.el @@ -335,7 +335,8 @@ last statement in BODY, as elisp." "python-"))) (with-temp-file tmp-src-file (insert body)) (format org-babel-python--exec-tmpfile - tmp-src-file)) + (org-babel-process-file-name + tmp-src-file 'noquote))) body))) (mapconcat #'org-trim @@ -353,7 +354,8 @@ last statement in BODY, as elisp." "python-"))) (with-temp-file tmp-src-file (insert body)) (format org-babel-python--eval-ast - tmp-src-file)))) + (org-babel-process-file-name + tmp-src-file 'noquote))))) (org-babel-comint-with-output (session org-babel-python-eoe-indicator nil body) (let ((comint-process-echoes nil)) -- 2.28.0 --=-=-=--