GNU bug report logs -
#68976
30.0.50; Tramp: unexpected error when calling (file-remote-p "/dav:localhost#8000:/foo")
Previous Next
Reported by: Ihor Radchenko <yantar92 <at> posteo.net>
Date: Wed, 7 Feb 2024 16:06:02 UTC
Severity: normal
Found in version 30.0.50
Fixed in version 30.1
Done: Michael Albinus <michael.albinus <at> gmx.de>
Bug is archived. No further changes may be made.
Full log
Message #17 received at 68976 <at> debbugs.gnu.org (full text, mbox):
Ihor Radchenko <yantar92 <at> posteo.net> writes:
> Hello,
Hi Ihor,
> Today, I tried to execute an innocent test checking if a file is remote
> or not:
>
> (file-remote-p "/dav:localhost#8000:/foo")
>
> Unexpectedly, I encountered user error
> tramp-error: Package `tramp-gvfs' not supported
>
> I did not expect that `file-remote-p' should ever throw an error other
> than when passed non-string argument.
You are right. It should have returned nil instead of the
error. `file-remote-p' claims in its docstring
--8<---------------cut here---------------start------------->8---
Test whether FILE specifies a location on a remote system.
--8<---------------cut here---------------end--------------->8---
> Looking at the code, (setq tramp-gvfs-enabled t) would make the error
> disappear. (The default value is nil)
If tramp-gvfs-enabled is nil (default value if D-Bus is not enabled),
the example given above does not specify "a location on a remote system".
> I believe that it is inappropriate that throw an error in such
> situation. If "gvfs" is not supported, but still claimed to be remote by
> TRAMP, I expect non-nil return value when calling `file-remote-p'; not
> an error.
Tramp does not claim it is remote. However, it should return nil.
If you want to know, whether a file name has remote file name syntax,
you should call
(string-match-p tramp-file-name-regexp "/dav:localhost#8000:/foo")
This variable is documented in the Tramp manual, node "(tramp) Change
file name syntax".
I will fix it on master (returning nil but an error).
Best regards, Michael.
This bug report was last modified 1 year and 185 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.