From unknown Sun Jul 13 20:28:30 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#58227 <58227@debbugs.gnu.org> To: bug#58227 <58227@debbugs.gnu.org> Subject: Status: 29.0.50; gnus-read-ephemeral-bug-group overrides `coding` cookie in url/cookies Reply-To: bug#58227 <58227@debbugs.gnu.org> Date: Mon, 14 Jul 2025 03:28:30 +0000 retitle 58227 29.0.50; gnus-read-ephemeral-bug-group overrides `coding` coo= kie in url/cookies reassign 58227 emacs submitter 58227 Stefan Monnier severity 58227 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 01 10:35:51 2022 Received: (at submit) by debbugs.gnu.org; 1 Oct 2022 14:35:51 +0000 Received: from localhost ([127.0.0.1]:45501 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oedap-000168-5Q for submit@debbugs.gnu.org; Sat, 01 Oct 2022 10:35:51 -0400 Received: from lists.gnu.org ([209.51.188.17]:50980) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oedan-000161-Tg for submit@debbugs.gnu.org; Sat, 01 Oct 2022 10:35:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49688) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oedam-0001ER-O1 for bug-gnu-emacs@gnu.org; Sat, 01 Oct 2022 10:35:49 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:46494) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oedaj-0007jQ-KB for bug-gnu-emacs@gnu.org; Sat, 01 Oct 2022 10:35:47 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 31185100121 for ; Sat, 1 Oct 2022 10:35:44 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 77B4A1000DF for ; Sat, 1 Oct 2022 10:35:42 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1664634942; bh=eNG21JuRP0kKNjdi/QbFWC3E1F2mIN0z43hUvcht9IY=; h=From:To:Subject:Date:From; b=gHPJr6/T1kSe3pCdD52cWjGVdv92rC7Q1BifiV7+m8+LMeEV7uh/dENi1NS+safYK kWCnXuTsGlL+8wtRo4hrqaCrrz0F0RRy0OJk8eaQYV3RPO861mm1Lz6UwFsodgw2Xp RRsMmZqEW3v1K7mBpenekRCveHNzz9AEKGJngtnDuBgVnEX3ypQAFFtxnL5zgm5jOE gc9eArlk/JTjBoy+TVZpuQAlha/+mWsDE8asMk4LNPRz0TfiOunICX/2u6bhhtkNqR lW+85TDTXvVTZz6XpixXEmAgZFLxt3WLikPRYClv8u8HRTMg3iBuzB8WK7yIQyhyS5 9XdRfQWH7DMzA== Received: from pastel (65-110-220-202.cpe.pppoe.ca [65.110.220.202]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 567B7120206 for ; Sat, 1 Oct 2022 10:35:42 -0400 (EDT) From: Stefan Monnier To: bug-gnu-emacs@gnu.org Subject: 29.0.50; gnus-read-ephemeral-bug-group overrides `coding` cookie in url/cookies Date: Sat, 01 Oct 2022 10:35:33 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.039 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Package: Emacs Version: 29.0.50 `gnus-read-ephemeral-bug-group` can cause the ~/emacs.d/url/cookies file (which is labeled with a `coding: utf-8-emacs-unix` cookie) to be read as a binary file. This may look somewhat minor but it's a symptom of a further reaching problem. The code does the following: (let ((coding-system-for-write 'binary) (coding-system-for-read 'binary)) (with-temp-file tmpfile (mm-disable-multibyte) (dolist (id ids) (let ((file (expand-file-name id (locate-user-emacs-file "debbugs-cache")))) (if (and (not gnus-plugged) (file-exists-p file)) (insert-file-contents file) ;; Pass non-nil VISIT to avoid errors with non-nil ;; `url-automatic-caching' (bug#26063, bug#29008) ;; and immediately unvisit. ;; FIXME: This masks real errors! (url-insert-file-contents (format mbox-url id) t) (setq buffer-file-name nil)))) (goto-char (point-min)) ;; Throw an informative error early instead of passing nonsense ;; to `gnus-group-read-ephemeral-group' (bug#36433). (unless (save-excursion (re-search-forward delim nil t)) (error "Invalid mbox format for bug IDs: %s" (string-join ids ", "))) (while (re-search-forward delim nil t) (narrow-to-region (point) (if (search-forward "\n\n" nil t) (1- (point)) (point-max))) (unless (string-match-p address-re (concat (message-fetch-field "to") " " (message-fetch-field "cc"))) (goto-char (point-min)) (if (not (re-search-forward "^To:" nil t)) (insert "To: " address "\n") (message-next-header) (skip-chars-backward "\t\n ") (insert ", " address))) (goto-char (point-max)) (widen)))) Any ELisp source file loaded while executing this code (such as autoloaded files, or ~/.emacs.d/url/cookies which gets read via url-insert-file-contents => url-retrieve-synchronously => url-do-setup => url-cookie-parse-file) will be decoded as a binary file rather than as UTF-8. And any other auxiliary reading/writing of files and processes that could be happening along the way would also be affected by the `coding-system-for-read/write` bindings. This is a general problem with let-binding `coding-system-for-read/write`, which is sometimes the only way to get what we need from ELisp. In this case, maybe we can use `insert-file-contents-literally` (and maybe we should introduce a `url-insert-file-contents-literally` too?). Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 02 08:58:53 2022 Received: (at 58227) by debbugs.gnu.org; 2 Oct 2022 12:58:53 +0000 Received: from localhost ([127.0.0.1]:46468 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oeyYX-0005VA-0j for submit@debbugs.gnu.org; Sun, 02 Oct 2022 08:58:53 -0400 Received: from quimby.gnus.org ([95.216.78.240]:49600) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oeyYT-0005Uk-Sh for 58227@debbugs.gnu.org; Sun, 02 Oct 2022 08:58:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=sHOoH0EZD9h2xlsh2omtajlrpuxFtU2r+vMWVr7eL6I=; b=BqW7d6375plX5kk6v/TKfcB6C3 e8M2BZyBlGWDXFN9PtqNxWeJarovOu0s/7bw/LwTZCD36uM3lvHw2td0DzVQ3qi88a+zqVr+dxj6E mqD+rJ5+J22FAQp2uSa6hfmui2JfYObx/uzj18IDTWpWO9o6SOJiKbT3wDXyks8an0kQ=; Received: from [84.212.220.105] (helo=downe) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oeyYK-0007Jj-0r; Sun, 02 Oct 2022 14:58:42 +0200 From: Lars Ingebrigtsen To: Stefan Monnier Subject: Re: bug#58227: 29.0.50; gnus-read-ephemeral-bug-group overrides `coding` cookie in url/cookies In-Reply-To: (Stefan Monnier's message of "Sat, 01 Oct 2022 10:35:33 -0400") References: X-Now-Playing: Des Airs's _It's a Crammed, Crammed, Crammed, Crammed World!_: "Lovely Lady of the Roses" Date: Sun, 02 Oct 2022 14:58:39 +0200 Message-ID: <87ill2crgg.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Stefan Monnier writes: > This is a general problem with let-binding > `coding-system-for-read/write`, which is sometimes the only way to get > what we need from ELisp. In this case, maybe we can use > `insert-file-contents- [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58227 Cc: 58227@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Stefan Monnier writes: > This is a general problem with let-binding > `coding-system-for-read/write`, which is sometimes the only way to get > what we need from ELisp. In this case, maybe we can use > `insert-file-contents-literally` (and maybe we should introduce > a `url-insert-file-contents-literally` too?). Now done in Emacs 29. From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 02 08:58:56 2022 Received: (at control) by debbugs.gnu.org; 2 Oct 2022 12:58:56 +0000 Received: from localhost ([127.0.0.1]:46475 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oeyYa-0005VX-23 for submit@debbugs.gnu.org; Sun, 02 Oct 2022 08:58:56 -0400 Received: from quimby.gnus.org ([95.216.78.240]:49614) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oeyYX-0005Up-Hc for control@debbugs.gnu.org; Sun, 02 Oct 2022 08:58:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ysy8uaB/kPM9eERuGvSxIuaKlUB/F5y1l5Tm6C/jux8=; b=oH55FLYODbM/A4rEOkrXEJNEvQ s/gCajJAPTgsKs8pUR8wGJ5zQTWi4QczRTpcYZ3AbpZNZOHByB7Ifz4AnG+yJu8x6RVkFbr9drNmN 5ihvCjvK7Nvlo/Ot0HdxadpWWYAUgNGAmmaJqrGDbNWagwy6SNnB4V9AExmqNqYFohuM=; Received: from [84.212.220.105] (helo=downe) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oeyYP-0007Jq-PF for control@debbugs.gnu.org; Sun, 02 Oct 2022 14:58:47 +0200 Date: Sun, 02 Oct 2022 14:58:45 +0200 Message-Id: <87h70mcrga.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #58227 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 58227 29.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) close 58227 29.1 quit From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 02 20:33:36 2022 Received: (at 58227-done) by debbugs.gnu.org; 3 Oct 2022 00:33:36 +0000 Received: from localhost ([127.0.0.1]:48429 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1of9Oq-0007Q8-Bf for submit@debbugs.gnu.org; Sun, 02 Oct 2022 20:33:36 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:33299) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1of9Oo-0007Pq-CA for 58227-done@debbugs.gnu.org; Sun, 02 Oct 2022 20:33:35 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id B66C1100138; Sun, 2 Oct 2022 20:33:27 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 5DA8C1000D5; Sun, 2 Oct 2022 20:33:26 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1664757206; bh=Z537ukeTtvBLXGtTk3yybq663oX76LjoXIU2Wht9G/g=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=aldwSUHS/5mbvZc9osQQB9XDuwTP4fZW+Hka8OTvsjeBDe42YUTWdmdZsr9Q70ZU4 bSCKFCE2izp/G1yI/Jq/6t2KCMK4TTOJo+hzR7cLnY42mQ4VK3T7gVCYNakply66YM BJvpZhlIvjRKFvwBHtPcE43qslKH3UlpOdhhSzS+peXgpQ96zD7qjbbrLoGCQqtFH7 i1bdzxp3oMzqPNLyLeXQKqO6BEhMphtOLcaSi+ys7SMU8oELKN0+H8V1LouEE19mxt ezsoiXkrtX48Spe9nACpl2oaX7xJTTUYb7AbYMibgwvPa5ubBCFpP4cNEo4fRdocqW n/R4jqGHikRpg== Received: from alfajor (65-110-220-202.cpe.pppoe.ca [65.110.220.202]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 11F6A1208A6; Sun, 2 Oct 2022 20:33:26 -0400 (EDT) From: Stefan Monnier To: Lars Ingebrigtsen Subject: Re: bug#58227: 29.0.50; gnus-read-ephemeral-bug-group overrides `coding` cookie in url/cookies In-Reply-To: <87ill2crgg.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 02 Oct 2022 14:58:39 +0200") Message-ID: References: <87ill2crgg.fsf@gnus.org> Date: Sun, 02 Oct 2022 20:33:20 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.061 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58227-done Cc: 58227-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Lars Ingebrigtsen [2022-10-02 14:58:39] wrote: > Stefan Monnier writes: >> This is a general problem with let-binding >> `coding-system-for-read/write`, which is sometimes the only way to get >> what we need from ELisp. In this case, maybe we can use >> `insert-file-contents-literally` (and maybe we should introduce >> a `url-insert-file-contents-literally` too?). > Now done in Emacs 29. Thanks, Stefan From unknown Sun Jul 13 20:28:30 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 31 Oct 2022 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator