-2014-07-28 Eli Zaretskii <eliz@gnu.org>
+2014-07-28 Emilio C. Lopes <eclig@gmx.net>
+
+ * net/tramp-sh.el (tramp-get-remote-python): Also search for
+ executables named "python2" or "python3".
+ (tramp-get-remote-uid-with-python): Use parentheses around
+ arguments to `print' to make it compatible with Python 3.
+ (tramp-get-remote-gid-with-python): Ditto. (Bug#18118)
+
+22014-07-28 Eli Zaretskii <eliz@gnu.org>
* window.el (window--pixel-to-total): Use FRAME's root window, not
that of the selected frame. (Bug#18112, Bug#16674)
(defun tramp-get-remote-python (vec)
(with-tramp-connection-property vec "python"
(tramp-message vec 5 "Finding a suitable `python' command")
- (tramp-find-executable vec "python" (tramp-get-remote-path vec))))
+ (or (tramp-find-executable vec "python" (tramp-get-remote-path vec))
+ (tramp-find-executable vec "python2" (tramp-get-remote-path vec))
+ (tramp-find-executable vec "python3" (tramp-get-remote-path vec)))))
(defun tramp-get-remote-uid-with-python (vec id-format)
(tramp-send-command-and-read
(format "%s -c \"%s\""
(tramp-get-remote-python vec)
(if (equal id-format 'integer)
- "import os; print os.getuid()"
- "import os, pwd; print '\\\"' + pwd.getpwuid(os.getuid())[0] + '\\\"'"))))
+ "import os; print (os.getuid())"
+ "import os, pwd; print ('\\\"' + pwd.getpwuid(os.getuid())[0] + '\\\"')"))))
(defun tramp-get-remote-uid (vec id-format)
(with-tramp-connection-property vec (format "uid-%s" id-format)
(format "%s -c \"%s\""
(tramp-get-remote-python vec)
(if (equal id-format 'integer)
- "import os; print os.getgid()"
- "import os, grp; print '\\\"' + grp.getgrgid(os.getgid())[0] + '\\\"'"))))
+ "import os; print (os.getgid())"
+ "import os, grp; print ('\\\"' + grp.getgrgid(os.getgid())[0] + '\\\"')"))))
(defun tramp-get-remote-gid (vec id-format)
(with-tramp-connection-property vec (format "gid-%s" id-format)