Subject: 24.2.50; python-shell-switch-to-shell in TRAMP buffer gives "No such file or directory: '/var/folders/vk/p95wm1qx0vdf0087p0z9qzc40000gn/T/py62333GTT'"

From: Matt McClure <[email-masked]>
Date: Mon, 3 Sep 2012 19:34:09 -0400

Here's a patch that I think might resolve the issue. Only lightly tested.

--- python.el.orig	2012-09-03 19:30:56.000000000 -0400
+++ python.el	2012-09-03 19:31:56.000000000 -0400
@@ -1824,7 +1824,13 @@
         (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"))
+
+        (let* ((temporary-file-directory
+                (if (file-remote-p default-directory)
+                    (concat (file-remote-p default-directory) "/tmp")
+                  temporary-file-directory))
+               (f (make-temp-file "py"))
+               (temp-file-name (or (file-remote-p f 'localname) f))
                (file-name (or (buffer-file-name) temp-file-name)))
           (with-temp-file temp-file-name
             (insert string)

-- 
Matt McClure
http://www.matthewlmcclure.com
http://www.mapmyfitness.com/profile/matthewlmcclure