emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: paul <paul_lodder@live.nl>
To: emacs-orgmode@gnu.org
Subject: Bug report: remote file python src output gives FileNotFound (+ suggested fix)
Date: Mon, 23 Nov 2020 18:26:38 +0100	[thread overview]
Message-ID: <AM0PR04MB526529A6010AC5F5E669B17883FC0@AM0PR04MB5265.eurprd04.prod.outlook.com> (raw)

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	other threads:[~2020-11-24 17:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-23 17:26 paul [this message]
2020-11-28 17:25 ` Bug report: remote file python src output gives FileNotFound (+ suggested fix) Jack Kamm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM0PR04MB526529A6010AC5F5E669B17883FC0@AM0PR04MB5265.eurprd04.prod.outlook.com \
    --to=paul_lodder@live.nl \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).