ITADN

"Not a directory" errors while searching for "FILE.py/.editorconfig"

#91Opentzz 创建于 2026-02-20
T
tzzcommented
I use [editorconfig](https://github.com/editorconfig/editorconfig-emacs) When I open a remote `FILE.py`, tramp-rpc tries to load the file `FILE.py/.editorconfig` which doesn't exist, and that throws an error which interrupts the loading and fontification of the Python code. The below patch fixes it ``` diff --git i/lisp/tramp-rpc.el w/lisp/tramp-rpc.el index eb1f04b..13854c5 100644 --- i/lisp/tramp-rpc.el +++ w/lisp/tramp-rpc.el @@ -1245,7 +1245,8 @@ defun tramp-rpc-handle-file-executable-p (file-error ;; Return nil for ELOOP (symlink loop) - file can't be resolved, ;; so it effectively doesn't exist for stat purposes. - (if (string-match-p "Too many levels of symbolic links" (cadr err)) + (if (or (string-match-p "Too many levels of symbolic links" (cadr err)) + (string-match-p "Not a directory" (cadr err))) nil (signal (car err) (cdr err))))))) ``` but - I'm not sure why editorconfig is trying to load this file under a python script's name anyway - the error still shows up in `*Messages*` ``` Tramp: Inserting ‘/rpc:tzz@mymachine:/home/tzz/myfile.py’...done File error: RPC Not a directory Not a directory (os error 20) ``` so I'm not sure my patch is the right way to solve this.
0 条评论