Browse Source

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
Christian Vanderwall 4 years ago
parent
commit
312a646fb8
1 changed files with 4 additions and 2 deletions
  1. 4 2
      lisp/ob-python.el

+ 4 - 2
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))