I use Emacs 27.2 on Windows 10. Working with packages used to work, but now I am getting Failed to download ‘gnu’ archive., when calling for instance M-x package-refresh-contents. I tried M-x toggle-debug-on-error, and in the call stack I see Debugger entered--Lisp error: (wrong-type-argument listp \357\273\277) So the BOM symbol is involved.

Update 1 I have confirmed that running emacs -Q makes the error go away. So then I have stripped my init file to contain only:

(setq user-emacs-directory "C:/users/avpas/.emacs.d")

(add-to-list 'load-path "~/.emacs.d")

To clearify, my HOME is set to other than C:/users/avpas. At this point, the error persists, but goes away when I remove the first row (setq user-emacs-directory "C:/users/avpas/.emacs.d").

  • Set debug-on-error to t and show the backtrace here.
    – Drew
    Jun 4, 2022 at 16:42
  • Do you see the same thing if you start Emacs with emacs -Q? If not, bisect your init file to find the culprit. If yes, provide a step-by-step recipe to reproduce the problem, starting from emacs -Q.
    – Drew
    Jun 4, 2022 at 16:43

1 Answer 1


So I looked up to reset the Emacs's state, which is saved in .emacs.d directory (user-emacs-directory). I created a backup copy of that directory. Then I looked inside it, and the most suspicious looking file was network-security.data. I deleted it and restarted Emacs. Voila, the problem was gone.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.