Sorry to reply late.

I could not patch your patch file on my Emacs 26.1 tramp.el. I guess I will wait until I get time to have Emacs 26.2 installed and test your change again.

Wanrong

On 5/26/2019 3:50 PM, Michael Albinus wrote:
Wanrong Lin <wrglin@gmail.com> writes:

Hi Michael:
Hi Wanrong,

[Pls keep the Cc, for the archives]

I just tested your patch (on Emacs 26.1 as I don't yet have a working
Emacs 26.2 set up) , and unfortunately it did not seem to fix the
issue. Would you mind taking a look at it again? Thanks.
Well, I have hard times to reproduce your problem. Anyway, could you try
the appended patch instead?

Wanrong
Best regards, Michael.


*** /tmp/ediff16zXeN	2019-05-26 21:45:35.446178244 +0200
--- /net/ford/albinus/src/tramp/lisp/tramp.el	2019-05-26 21:44:57.446575193 +0200
***************
*** 4676,4681 ****
--- 4676,4682 ----
  PROGRAM is nil is trapped also, returning 1.  Furthermore, traces
  are written with verbosity of 6."
    (let ((default-directory (tramp-compat-temporary-file-directory))
+ 	(process-environment (default-toplevel-value 'process-environment))
  	(destination (if (eq destination t) (current-buffer) destination))
  	(vec (or vec (car tramp-current-connection)))
  	output error result)
***************
*** 4709,4714 ****
--- 4710,4716 ----
  PROGRAM is nil is trapped also, returning 1.  Furthermore, traces
  are written with verbosity of 6."
    (let ((default-directory (tramp-compat-temporary-file-directory))
+ 	(process-environment (default-toplevel-value 'process-environment))
  	(buffer (if (eq buffer t) (current-buffer) buffer))
  	result)
      (tramp-message
***************
*** 4738,4743 ****
--- 4740,4746 ----
  If an error occurs, it returns nil.  Traces are written with
  verbosity of 6."
    (let ((default-directory (tramp-compat-temporary-file-directory))
+ 	(process-environment (default-toplevel-value 'process-environment))
  	(vec (or vec (car tramp-current-connection)))
  	result)
      (if args