Org-mode mailing list
 help / color / mirror / Atom feed
* Bug report: remote file python src output gives FileNotFound (+ suggested fix)
@ 2020-11-23 17:26 paul
  2020-11-28 17:25 ` Jack Kamm
  0 siblings, 1 reply; 2+ messages in thread
From: paul @ 2020-11-23 17:26 UTC (permalink / raw)
  To: emacs-orgmode

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)


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Bug report: remote file python src output gives FileNotFound (+ suggested fix)
  2020-11-23 17:26 Bug report: remote file python src output gives FileNotFound (+ suggested fix) paul
@ 2020-11-28 17:25 ` Jack Kamm
  0 siblings, 0 replies; 2+ messages in thread
From: Jack Kamm @ 2020-11-28 17:25 UTC (permalink / raw)
  To: paul, emacs-orgmode

Hi Paul,

I'm unable to reproduce the issue, and believe this issue has already
been fixed in the latest version of org-mode. See this patch [1]. Could
you please upgrade to Org 9.4 and test again?

Thanks,
Jack

[1] https://orgmode.org/list/87h7t16red.fsf@pc.i-did-not-set--mail-host-address--so-tickle-me/


paul <paul_lodder@live.nl> writes:

> 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)


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-28 17:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-23 17:26 Bug report: remote file python src output gives FileNotFound (+ suggested fix) paul
2020-11-28 17:25 ` Jack Kamm

Org-mode mailing list

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://orgmode.org/list/0 list/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 list list/ https://orgmode.org/list \
		emacs-orgmode@gnu.org
	public-inbox-index list

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.orgmode
	nntp://news.gmane.io/gmane.emacs.orgmode


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git