GNU bug report logs - #54435
The test mailcap-parsing-and-mailcap-mime-info forgets to restore the HOME environment variable

Previous Next

Package: emacs;

Reported by: Felix Dietrich <felix.dietrich <at> sperrhaken.name>

Date: Thu, 17 Mar 2022 14:17:01 UTC

Severity: minor

Tags: patch

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 54435 in the body.
You can then email your comments to 54435 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#54435; Package emacs. (Thu, 17 Mar 2022 14:17:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Felix Dietrich <felix.dietrich <at> sperrhaken.name>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 17 Mar 2022 14:17:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Felix Dietrich <felix.dietrich <at> sperrhaken.name>
To: bug-gnu-emacs <bug-gnu-emacs <at> gnu.org>
Subject: The test mailcap-parsing-and-mailcap-mime-info forgets to restore
 the HOME environment variable
Date: Thu, 17 Mar 2022 15:16:19 +0100
[Message part 1 (text/plain, inline)]
Severity: minor
Tags: patch

Running the test ‘mailcap-parsing-and-mailcap-mime-info’ will set the
HOME environment variable to a temporary directory.  After the test the
directory is removed (thanks to the ‘ert-with-temp-directory’ macro),
but the value of the environment variable not restored, polluting the
state of a running Emacs and affecting later commands in the Emacs
session, like the vc-* commands when git cannot find its global
configuration anymore.

The patch wraps the test in a ‘let’ and ‘unwind-protect’ to restore the
value of the environment variable after the test has been run.

[0001-mailcap-tests-Restore-HOME-environment-variable.patch (text/x-diff, attachment)]
[Message part 3 (text/plain, inline)]

-- 
Felix Dietrich

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#54435; Package emacs. (Thu, 17 Mar 2022 15:13:01 GMT) Full text and rfc822 format available.

Message #8 received at 54435 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Felix Dietrich <felix.dietrich <at> sperrhaken.name>
Cc: 54435 <at> debbugs.gnu.org
Subject: Re: bug#54435: The test mailcap-parsing-and-mailcap-mime-info
 forgets to restore the HOME environment variable
Date: Thu, 17 Mar 2022 16:12:34 +0100
Felix Dietrich <felix.dietrich <at> sperrhaken.name> writes:

> The patch wraps the test in a ‘let’ and ‘unwind-protect’ to restore the
> value of the environment variable after the test has been run.

Thanks.  I've now applied a similar change to Emacs 29, but used
`with-environment-variables' instead of let/unwind-protect.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 29.1, send any further explanations to 54435 <at> debbugs.gnu.org and Felix Dietrich <felix.dietrich <at> sperrhaken.name> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 17 Mar 2022 15:13:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 15 Apr 2022 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 65 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.