GNU bug report logs - #37202
shadowfile-tests: two failures on macOS

Previous Next

Package: emacs;

Reported by: Stefan Kangas <stefan <at> marxist.se>

Date: Wed, 28 Aug 2019 00:42:02 UTC

Severity: normal

Fixed in version 27.1

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


Message #67 received at 37202 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: Glenn Morris <rgm <at> gnu.org>, Stefan Kangas <stefan <at> marxist.se>,
 37202 <at> debbugs.gnu.org
Subject: Re: bug#37202: shadowfile-tests: two failures on macOS
Date: Fri, 20 Sep 2019 14:35:52 +0200
Paul Eggert <eggert <at> cs.ucla.edu> writes:

Hi Paul,

> Could you explain how the backtrace implicates file-attributes? I see
> the following in the backtrace, but I don't see file-attributes listed
> there, and when I look at the tramp-handle-file-modes source it
> appears that file-attributes returned nil which is what I think you
> expected.
>
> Test shadow-test08-shadow-todo backtrace:
>   signal(args-out-of-range ("([] 1)"))
>   tramp-signal-hook-function(args-out-of-range ([] 1))
>   tramp-mode-string-to-int(nil)
>
> tramp-handle-file-modes(#("/mock:localhost:/build/shadowfile-tests75GTBI"
> 6 15 (tramp-default t)))

Right, `file-attributes' does not seem to have raised an error. But it
still seems to behave differently. The code is

--8<---------------cut here---------------start------------->8---
(defun tramp-handle-file-modes (filename)
  "Like `file-modes' for Tramp files."
  (let ((truename (or (file-truename filename) filename)))
    (when (file-exists-p truename)
      (tramp-mode-string-to-int
       (tramp-compat-file-attribute-modes (file-attributes truename))))))
--8<---------------cut here---------------end--------------->8---

That means, (file-attributes truename) returns nil although
(file-exists-p truename) returns non-nil. That seems to be a changed
behaviour to me, I don't remember having seen this before.

Arguably, the test shall better use `access-file' but
`file-exists-p'. But anyway, such subtle differences could break Tramp.

I still use conditional wording, because I cannot debug on hydra. And I
cannot say for sure that your changes have caused the problem.

For the time being, I'll adapt `tramp-handle-file-modes' in order to
unbreak the errors on hydra.

Best regards, Michael.




This bug report was last modified 5 years and 227 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.