elfeed icon indicating copy to clipboard operation
elfeed copied to clipboard

elfeed update mkdir error on emacs 29.1

Open ratnesh1729 opened this issue 1 year ago • 3 comments

Thank you for the nice package. Running elfeed-update gives me this error (vanilla elfeed setup)

[2024-06-17 06:54:17] [error]: http://nullprogram.com/feed/: (wrong-number-of-arguments (lambda (dir) Make directory `dir' and don't signal error if it already exists. (if (not (file-directory-p dir)) (progn (make-directory dir)))) 2)
[2024-06-17 06:54:17] [error]: http://nedroid.com/feed/: (wrong-number-of-arguments (lambda (dir) Make directory `dir' and don't signal error if it already exists. (if (not (file-directory-p dir)) (progn (make-directory dir)))) 2)
[2024-06-17 06:54:17] [error]: http://www.50ply.com/atom.xml: (wrong-number-of-arguments (lambda (dir) Make directory `dir' and don't signal error if it already exists. (if (not (file-directory-p dir)) (progn (make-directory dir)))) 2)

I traced this is coming from mkdir in elfeed-db.el

Debugger entered--Lisp error: (wrong-number-of-arguments (lambda (dir) "Make directory `dir' and don't signal error if it ..." (if (not (file-directory-p dir)) (progn (make-directory dir)))) 2)
  mkdir("~/.elfeed" t)
  elfeed-db-save()
  elfeed-update()
  funcall-interactively(elfeed-update)
  command-execute(elfeed-update record)
  #<subr execute-extended-command>(nil "elfeed-update" nil)
  ad-Advice-execute-extended-command(#<subr execute-extended-command> nil "elfeed-update" nil)
  apply(ad-Advice-execute-extended-command #<subr execute-extended-command> (nil "elfeed-update" nil))
  execute-extended-command(nil "elfeed-update" nil)
  funcall-interactively(execute-extended-command nil "elfeed-update" nil)
  command-execute(execute-extended-command)

Seeking pointers etc here.

Thank you!

ratnesh1729 avatar Jun 17 '24 13:06 ratnesh1729

The mkdir docstring in your trace appears nowhere in Emacs, and I can't find a single instance of that string when searching online. Someone or something, which has never been published to the internet, is redefining your mkdir function. The redefinition is not even byte-compiled, so it's not part of your Emacs installation.

(I was concerned that upstream Emacs development broke this interface, but fortunately that's not the case.)

skeeto avatar Jun 17 '24 18:06 skeeto

Managed to find a near-match here: https://github.com/netromdk/.emacs.d/blob/26739c81/lisp/2-functions.el#L235-L238

Seems your local definition was copied from here and changed, vice versa, or there's some original common source. Aside from having the wrong number of arguments, this definition also comes with a TOCTOU race condition.

skeeto avatar Jun 17 '24 18:06 skeeto

Thanks! I have been using identical one. I must have copied from his file. I will purge this.

Thank you again!

ratnesh1729 avatar Jun 17 '24 18:06 ratnesh1729