From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#34909: 26.1; Error refreshing packages under language environment Date: Tue, 19 Mar 2019 20:44:16 +0200 Message-ID: <83mulqu2kf.fsf@gnu.org> References: <83zhprt8eo.fsf@gnu.org> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="13770"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 34909@debbugs.gnu.org, choroba@matfyz.cz To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Mar 19 19:59:58 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h6Jxu-0003WO-N6 for geb-bug-gnu-emacs@m.gmane.org; Tue, 19 Mar 2019 19:59:58 +0100 Original-Received: from localhost ([127.0.0.1]:33487 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h6Jxt-0001Pi-K7 for geb-bug-gnu-emacs@m.gmane.org; Tue, 19 Mar 2019 14:59:57 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:39180) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h6JxE-0000rt-CM for bug-gnu-emacs@gnu.org; Tue, 19 Mar 2019 14:59:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h6JjT-0005PM-0X for bug-gnu-emacs@gnu.org; Tue, 19 Mar 2019 14:45:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37312) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h6JjS-0005P4-Pn for bug-gnu-emacs@gnu.org; Tue, 19 Mar 2019 14:45:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1h6JjS-0008CJ-L8 for bug-gnu-emacs@gnu.org; Tue, 19 Mar 2019 14:45:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 Mar 2019 18:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34909 X-GNU-PR-Package: emacs Original-Received: via spool by 34909-submit@debbugs.gnu.org id=B34909.155302109131481 (code B ref 34909); Tue, 19 Mar 2019 18:45:02 +0000 Original-Received: (at 34909) by debbugs.gnu.org; 19 Mar 2019 18:44:51 +0000 Original-Received: from localhost ([127.0.0.1]:50856 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h6JjG-0008Bg-81 for submit@debbugs.gnu.org; Tue, 19 Mar 2019 14:44:50 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:51362) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h6JjE-0008BQ-6u for 34909@debbugs.gnu.org; Tue, 19 Mar 2019 14:44:49 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:34087) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h6Jj5-0004vp-UP; Tue, 19 Mar 2019 14:44:40 -0400 Original-Received: from [176.228.60.248] (port=4637 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1h6Jj1-0004Id-1o; Tue, 19 Mar 2019 14:44:39 -0400 In-reply-to: (message from Stefan Monnier on Tue, 19 Mar 2019 12:27:24 -0400) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:156511 Archived-At: > From: Stefan Monnier > Cc: "E. Choroba" , 34909@debbugs.gnu.org > Date: Tue, 19 Mar 2019 12:27:24 -0400 > > > - (progn (write-region content nil local-file nil 'silent) > > + (progn (let ((coding-system-for-write 'utf-8)) > > + (write-region content nil local-file nil 'silent)) > > This is probably safe, but I think the buffer should be unibyte It isn't unibyte because no one makes it unibyte. package.el uses temporary buffers with no special settings, so everything is basically determined by user locale's defaults. > and if it isn't I think it indicates a bug elsewhere (likely in > package--with-response-buffer tho its use in describe-package-1 > might prefer a decoded (aka multibyte) result). Feel free to work on package--with-response-buffer in this direction. Debugging this was a small nightmare, due to the use of macros and async retrieval with callbacks, so I felt lucky when I finally found the problematic code and understood why it worked in the English language environment. I don't feel I know enough about package.el to make more significant changes, sorry, and as you point out, it is used in several places in several different ways. (I also don't understand why you say the buffer must be unibyte: if the coding-systems for each operation are set correctly, there should be no difference at all, not nowadays. IME, using unibyte buffers is just the easy way out when one doesn't want to mess with the coding-systems stuff.)