From 3430c12154579103c3de991bcda4558ed46a485e Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sat, 17 Apr 2021 16:39:14 +0200 Subject: [PATCH] Make stderr in Tramp's make-process more robust * lisp/net/tramp-sh.el (tramp-sh-handle-make-process): Wrap about error in inserting stderr file. * lisp/net/tramp.el (tramp-handle-make-process): Fix docstring. --- lisp/net/tramp-sh.el | 10 +++++++--- lisp/net/tramp.el | 3 +-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 651444b9e03..df64d13c41f 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -2923,15 +2923,19 @@ alternative implementation will be used." ;; until the process is deleted. (when (bufferp stderr) (with-current-buffer stderr - (insert-file-contents-literally remote-tmpstderr)) + ;; There's a mysterious error, see + ;; . + (ignore-errors + (insert-file-contents-literally remote-tmpstderr))) ;; Delete tmpstderr file. (add-function :after (process-sentinel p) (lambda (_proc _msg) (when (file-exists-p remote-tmpstderr) (with-current-buffer stderr - (insert-file-contents-literally - remote-tmpstderr nil nil nil 'replace)) + (ignore-errors + (insert-file-contents-literally + remote-tmpstderr nil nil nil 'replace))) (delete-file remote-tmpstderr))))) ;; Return process. p))) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 8da94ec9d9e..a411aafa875 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -3888,8 +3888,7 @@ substitution. SPEC-LIST is a list of char/value pairs used for (or (not (stringp stderr)) (not (tramp-tramp-file-p stderr)))))) (defun tramp-handle-make-process (&rest args) - "An alternative `make-process' implementation for Tramp files. -It does not support `:stderr'." + "An alternative `make-process' implementation for Tramp files." (when args (with-parsed-tramp-file-name (expand-file-name default-directory) nil (let ((default-directory (tramp-compat-temporary-file-directory)) -- 2.39.2