emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug report: remote file python src output gives FileNotFound (+ suggeste


From: paul
Subject: Bug report: remote file python src output gives FileNotFound (+ suggested fix)
Date: Mon, 23 Nov 2020 18:26:38 +0100
User-agent: mu4e 1.2.0; emacs 26.3

When working remotely, a python SRC block with a session and :results set to 
output will return a FileNotFoundError.
To reproduce this bug:
1. Open a .org file remotely
2. Insert the following
#+BEGIN_SRC python :results output :session check
print("a")
#+END_SRC
3. org-ctrl-c-ctrl-c in the code block

I already figured out how to fix it:
In ob-python.el.gz, the function org-babel-python-evaluate-session the 
let-variable tmp-src-file is made, which contains tramp-prefix when working 
remotely. But the tramp-prefix is still there here:
(format org-babel-python--exec-tmpfile tmp-src-file)
which causes the remotely executed command to still contain the prefix, and 
hence it cannot find it.
To fix, the line above could be replaced with
(format org-babel-python--exec-tmpfile (or (file-remote-p tmp-src-file 
'localname) tmp-src-file))

Hope this helps :) (and many many thanks for org-mode)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]