GNU bug report logs -
#12340
24.2.50; python-shell-switch-to-shell in TRAMP buffer gives "No such file or directory: '/var/folders/vk/p95wm1qx0vdf0087p0z9qzc40000gn/T/py62333GTT'"
Previous Next
Reported by: Matt McClure <matthewlmcclure <at> gmail.com>
Date: Mon, 3 Sep 2012 16:46:01 UTC
Severity: normal
Found in version 24.2.50
Done: Michael Albinus <michael.albinus <at> gmx.de>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Matt McClure <matthewlmcclure <at> gmail.com> writes:
> Actually, the first attempt didn't really work. Here's an updated
> patch: <https://github.com/matthewlmcclure/emacs/compare/master...debbug-12340>.
> I've tested this one on local and remote interpreters, using
> python-shell-send-{buffer,region,file}.
This are more than 15 changed lines, it doesn't count as tiny change. If
you want to get it pushed to Emacs, you would need to sign FSF legal
papers. Are you interested in?
I believe, the patch is too complicate. When you call
python-shell-send-file, you pass file-name in remote syntax, but
temp-file-name already stripped to the local file name part on the
remote side. This confuses, I believe. I wouldn't use
host-rel-temp-file-name here, and just pass temp-file-name as it is. All
the remote name strippings could be performed in python-shell-send-file.
Something like this (completely untested, but you get the idea):
--8<---------------cut here---------------start------------->8---
*** ~/src/emacs/lisp/progmodes/python.el.~109871~ 2012-09-05 16:01:08.029147300 +0200
--- ~/src/emacs/lisp/progmodes/python.el 2012-09-05 16:35:03.756949973 +0200
***************
*** 1824,1830 ****
(lines (split-string string "\n" t)))
(and msg (message "Sent: %s..." (nth 0 lines)))
(if (> (length lines) 1)
! (let* ((temp-file-name (make-temp-file "py"))
(file-name (or (buffer-file-name) temp-file-name)))
(with-temp-file temp-file-name
(insert string)
--- 1824,1834 ----
(lines (split-string string "\n" t)))
(and msg (message "Sent: %s..." (nth 0 lines)))
(if (> (length lines) 1)
! (let* ((temporary-file-directory
! (if (file-remote-p default-directory)
! (concat (file-remote-p default-directory) "/tmp")
! temporary-file-directory))
! (temp-file-name (make-temp-file "py"))
(file-name (or (buffer-file-name) temp-file-name)))
(with-temp-file temp-file-name
(insert string)
***************
*** 1940,1946 ****
(concat "__pyfile = open('''%s''');"
"exec(compile(__pyfile.read(), '''%s''', 'exec'));"
"__pyfile.close()")
! (or temp-file-name file-name) file-name)
process)))
(defun python-shell-switch-to-shell ()
--- 1944,1951 ----
(concat "__pyfile = open('''%s''');"
"exec(compile(__pyfile.read(), '''%s''', 'exec'));"
"__pyfile.close()")
! (or (file-remote-p temp-file-name 'localname) temp-file-name)
! (or (file-remote-p file-name 'localname) file-name))
process)))
(defun python-shell-switch-to-shell ()
--8<---------------cut here---------------end--------------->8---
Best regards, Michael.
This bug report was last modified 12 years and 320 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.