Subject: bug#53529: 29.0.50; Error with debbugs 0.30 from ELPA

From: Stefan Monnier <[email-masked]>
Date: Fri, 28 Jan 2022 23:22:00 -0500

> It does seem to be the trigger, but I wonder why we end up with some DOS
> EOLs in those files.
>
> The sample you sent shows that the ^M are present on those parts of the
> file what are "constant" at the beginning and the end.

Could you see if the patch below happens to help?

        Stefan

diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index aa3e48155c..2e01449613 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -1005,7 +1005,8 @@ package-autoload-ensure-default-file
   "Make sure that the autoload file FILE exists and if not create it."
   (unless (file-exists-p file)
     (require 'autoload)
-    (write-region (autoload-rubric file "package" nil) nil file nil 'silent))
+    (let ((coding-system-for-write 'utf-8-emacs-unix))
+      (write-region (autoload-rubric file "package" nil) nil file nil 'silent)))
   file)
 
 (defvar autoload-timestamps)