GNU bug report logs - #39672
28.0.50; can't visit directory in Dired

Previous Next

Package: emacs;

Reported by: Kan Sasaki <sasaki <at> fcc.ad.jp>

Date: Wed, 19 Feb 2020 03:43:02 UTC

Severity: normal

Fixed in version 28.0.50

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 39672 in the body.
You can then email your comments to 39672 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#39672; Package emacs. (Wed, 19 Feb 2020 03:43:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Kan Sasaki <sasaki <at> fcc.ad.jp>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 19 Feb 2020 03:43:02 GMT) Full text and rfc822 format available.

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

From: Kan Sasaki <sasaki <at> fcc.ad.jp>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; can't visit directory in Dired
Date: Wed, 19 Feb 2020 11:52:55 +0900 (JST)
[Message part 1 (text/plain, inline)]
In Dired, I can't visit directory which encoding is euc-jp.

When I type 'i' on the directory, emacs says 'Attempt to insert a
non-directory: DIRECTORY.' When I type 'RET' on the directory, emacs
says 'File exists, but cannot be read' and shows empty buffer.

This issue has occured since the following change:

9dc306b1db Improve reporting of I/O, access errors

I compared the files with the previous ones. I guess the attached
patch may fix this issue.


In GNU Emacs 28.0.50 (build 1, x86_64--freebsd, GTK+ Version 3.24.10, cairo version 1.16.0)
 of 2020-02-19 built on ayoki.noc.fcc.ad.jp
Repository revision: 2b04ca05ad9f3679a047ffc06b35d2d61d74b12e
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.11804000
System Description: 12.1-STABLE

Recent messages:
Connecting to the POP server...
Opening a TCP connection ...
Connecting to the POP server...done
Communicating with the POP server...
Sending your POP password to the POP server...
No new messages
[2] is nil. C)reate D)up P)reserve F)indfile B)uff X)M-x k)KeyFunc&exit N)o:
Switch to window[2]
Memorize current window configuration into 2
Opening a TCP connection ...

Configured using:
 'configure amd64--freebsd --prefix=/home/sasaki/local/emacs
 --with-x-toolkit=gtk3 --without-xim --disable-acl 'CFLAGS=-O2 -pipe'
 'CPPFLAGS=-O2 -pipe' LDFLAGS='

Configured features:
XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND DBUS GSETTINGS GLIB NOTIFY
KQUEUE GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS JSON PDUMPER
LCMS2 GMP

Important settings:
  value of $LC_COLLATE: C
  value of $LC_TIME: C
  value of $LANG: ja_JP.eucJP
  value of $XMODIFIERS: @im=uim
  locale-coding-system: japanese-iso-8bit-unix

Major mode: Lisp Interaction

Minor modes in effect:
  recentf-mode: t
  override-global-mode: t
  avy-migemo-mode: t
  global-ace-isearch-mode: t
  ace-isearch-mode: t
  helm-migemo-mode: t
  delete-selection-mode: t
  cua-mode: t
  show-paren-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
/home/sasaki/.emacs.d/elpa/28/magit-20200208.551/magit-section hides /home/sasaki/.emacs.d/elpa/28/magit-section-20200123.2235/magit-section
/home/sasaki/local/emacs/share/emacs/28.0.50/lisp/tempo hides /home/sasaki/.emacs.d/elisp/html-helper/OLD/tempo
/home/sasaki/.emacs.d/elisp/html-helper/html-helper-mode hides /home/sasaki/.emacs.d/elisp/html-helper/OLD/html-helper-mode

Features:
(shadow autoinsert emacsbug message rfc822 mml mml-sec epa derived epg
epg-config gnus-util rmail rmail-loaddefs text-property-search
time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail pp network-stream nsm rmc mew-varsx
mew-unix mail-utils c-sig mew-ical cal-menu calendar cal-loaddefs
rfc2047 rfc2045 mm-util mail-prsvr ietf-drums ht clearcite-mew
clearcite mew-w3m w3m mailcap doc-view jka-compr recentf-ext dired
dired-loaddefs image-mode exif timezone w3m-hist w3m-fb bookmark-w3m
w3m-ems w3m-favicon w3m-image tab-line w3m-proc w3m-util mew-auth
mew-config mew-imap2 mew-imap mew-nntp2 mew-nntp mew-pop mew-smtp
gnutls puny mew-ssl mew-ssh mew-net mew-highlight mew-sort mew-fib
mew-ext mew-refile mew-demo mew-attach mew-draft mew-message
mew-thread mew-virtual mew-summary4 mew-summary3 mew-summary2
mew-summary mew-search mew-pick mew-passwd mew-scan mew-syntax mew-bq
mew-smime mew-pgp mew-header mew-exec mew-mark mew-mime mew-edit
mew-decode mew-encode mew-cache mew-minibuf mew-complete mew-addrbook
mew-local mew-vars3 mew-vars2 mew-vars mew-env mew-lang-jp mew-mule3
mew-mule mew-gemacs mew-key mew-func mew-blvs mew-const mew ccc s dash
helm-ag compile comint ansi-color windows revive web-mode disp-table
sgml-mode dom sync-recentf recentf tree-widget wid-edit diff-mode
dabbrev-highlight dabbrev use-package-bind-key bind-key avy-migemo
migemo avy ring ace-isearch helm-swoop helm-grep helm-regexp
format-spec helm-utils helm-help helm easy-mmode edmacro kmacro
helm-source eieio-compat helm-multi-match helm-lib async ace-jump-mode
cl cl-extra help-mode use-package-core atomic-chrome websocket
url-cookie url-domsuf url-util bindat let-alist server delsel cua-base
windmove utf-7 paren term/bobcat session finder-inf tex-site advice
w3m-load info package easymenu browse-url url-handlers url-parse
auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache json subr-x map url-vars seq byte-opt gv bytecomp
byte-compile cconv cl-loaddefs cl-lib japan-util tooltip eldoc
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel
term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode
elisp-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core term/tty-colors frame minibuffer cl-generic
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet
lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak
czech european ethiopic indian cyrillic chinese composite charscript
charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote threads dbusbind
kqueue lcms2 dynamic-setting system-font-setting font-render-setting
cairo move-toolbar gtk x-toolkit x multi-tty make-network-process
emacs)

Memory information:
((conses 16 375112 16620)
 (symbols 48 29028 1)
 (strings 32 130163 2393)
 (string-bytes 1 3826791)
 (vectors 16 38708)
 (vector-slots 8 605645 18128)
 (floats 8 130 23)
 (intervals 56 827 0)
 (buffers 1000 11))
[fileio.c.diff (text/x-patch, inline)]
diff --git a/src/fileio.c b/src/fileio.c
index 87a17eab42..6b223e7078 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2924,16 +2924,18 @@ DEFUN ("file-directory-p", Ffile_directory_p, Sfile_directory_p, 1, 1, 0,
 bool
 file_directory_p (Lisp_Object file)
 {
+  Lisp_Object encoded = ENCODE_FILE (file);
+
 #ifdef DOS_NT
   /* This is cheaper than 'stat'.  */
-  bool retval = faccessat (AT_FDCWD, SSDATA (file), D_OK, AT_EACCESS) == 0;
+  bool retval = faccessat (AT_FDCWD, SSDATA (encoded), D_OK, AT_EACCESS) == 0;
   if (!retval && errno == EACCES)
     errno = ENOTDIR;	/* like the non-DOS_NT branch below does */
   return retval;
 #else
 # ifdef O_PATH
   /* Use O_PATH if available, as it avoids races and EOVERFLOW issues.  */
-  int fd = emacs_openat (AT_FDCWD, SSDATA (file),
+  int fd = emacs_openat (AT_FDCWD, SSDATA (encoded),
 			 O_PATH | O_CLOEXEC | O_DIRECTORY, 0);
   if (0 <= fd)
     {
@@ -2950,12 +2952,12 @@ file_directory_p (Lisp_Object file)
      is inaccessible, fall back on fstatat; if the latter fails with
      EOVERFLOW then FILE must have been a directory unless a race
      condition occurred (a problem hard to work around portably).  */
-  if (file_accessible_directory_p (file))
+  if (file_accessible_directory_p (encoded))
     return true;
   if (errno != EACCES)
     return false;
   struct stat st;
-  if (emacs_fstatat (AT_FDCWD, SSDATA (file), &st, 0) != 0)
+  if (emacs_fstatat (AT_FDCWD, SSDATA (encoded), &st, 0) != 0)
     return errno == EOVERFLOW;
   if (S_ISDIR (st.st_mode))
     return true;

Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Thu, 20 Feb 2020 02:07:02 GMT) Full text and rfc822 format available.

Notification sent to Kan Sasaki <sasaki <at> fcc.ad.jp>:
bug acknowledged by developer. (Thu, 20 Feb 2020 02:07:02 GMT) Full text and rfc822 format available.

Message #10 received at 39672-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Kan Sasaki <sasaki <at> fcc.ad.jp>
Cc: 39672-done <at> debbugs.gnu.org
Subject: 28.0.50; can't visit directory in Dired
Date: Wed, 19 Feb 2020 18:06:39 -0800
[Message part 1 (text/plain, inline)]
Thanks for reporting the bug. That is a regression in Emacs 27, and I 
reproduced the bug there, so I installed the attached patch (which is 
smaller and which I think is better) into the emacs-27 branch.

PS. Although I unfortunately mispelled your name in the attached file, I 
fixed the misspelling in the corresponding ChangeLog.3 file, which is 
what will be distributed in the next Emacs release. See:

https://git.savannah.gnu.org/cgit/emacs.git/commit/?h=emacs-27&id=1d10885763287f03a5fb348ba27715e049bb48f8
[0001-Fix-bug-when-visiting-euc-jp-encoded-directories.patch (text/x-patch, attachment)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 19 Mar 2020 11:24:04 GMT) Full text and rfc822 format available.

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

Previous Next


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