Debian Bug report logs - #760549
python-apt: apt_pkg.init_config() should apt_pkg.config.clean()

version graph

Package: python-apt; Maintainer for python-apt is APT Development Team <[email protected]>; Source for python-apt is src:python-apt (PTS, buildd, popcon).

Reported by: Raphaël Hertzog <[email protected]>

Date: Fri, 5 Sep 2014 07:57:07 UTC

Severity: wishlist

Tags: wontfix

Found in version python-apt/0.9.3.9

Full log


🔗 View this message in rfc822 format

X-Loop: [email protected]
Subject: Bug#760549: python-apt: apt_pkg.init_config() should apt_pkg.config.clean()
Reply-To: Raphael Hertzog <[email protected]>, [email protected]
Resent-From: Raphael Hertzog <[email protected]>
Resent-To: [email protected]
Resent-CC: APT Development Team <[email protected]>
X-Loop: [email protected]
Resent-Date: Fri, 05 Sep 2014 09:36:02 +0000
Resent-Message-ID: <[email protected]>
Resent-Sender: [email protected]
X-Debian-PR-Message: followup 760549
X-Debian-PR-Package: python-apt
X-Debian-PR-Keywords: wontfix
X-Debian-PR-Source: python-apt
Received: via spool by [email protected] id=B760549.140990959419740
          (code B ref 760549); Fri, 05 Sep 2014 09:36:02 +0000
Received: (at 760549) by bugs.debian.org; 5 Sep 2014 09:33:14 +0000
X-Spam-Checker-Version: SpamAssassin 3.3.2-bugs.debian.org_2005_01_02
	(2011-06-06) on buxtehude.debian.org
X-Spam-Level: 
X-Spam-Status: No, score=-9.0 required=4.0 tests=BAYES_00,FROMDEVELOPER,
	HAS_BUG_NUMBER,T_RP_MATCHES_RCVD autolearn=ham
	version=3.3.2-bugs.debian.org_2005_01_02
X-Spam-Bayes: score:0.0000 Tokens: new, 9; hammy, 150; neutral, 92; spammy, 1.
	spammytokens:0.953-+--our hammytokens:0.000-+--H*u:2014-03-12,
	0.000-+--H*UA:2014-03-12, 0.000-+--H*u:1.5.23, 0.000-+--H*UA:1.5.23,
	0.000-+--H*F:U*hertzog
Received: from mail.vm.ouaza.com ([212.83.178.2])
	by buxtehude.debian.org with esmtp (Exim 4.80)
	(envelope-from <[email protected]>)
	id 1XPptJ-00057f-RN
	for [email protected]; Fri, 05 Sep 2014 09:33:14 +0000
Received: from soleymieux.ouaza.com (home.ouaza.com [88.168.217.45])
	by mail.vm.ouaza.com (Postfix) with ESMTPSA id 3458020527;
	Fri,  5 Sep 2014 11:34:50 +0200 (CEST)
Received: by soleymieux.ouaza.com (Postfix, from userid 1000)
	id 337F65A0515; Fri,  5 Sep 2014 11:33:12 +0200 (CEST)
Date: Fri, 5 Sep 2014 11:33:12 +0200
From: Raphael Hertzog <[email protected]>
To: Julian Andres Klode <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
References: <[email protected]>
 <[email protected]>
 <CAEA6rAwhhxKRao8=aS3gj4O8JXXhpE33NAm6LvJXr3EjKE6Akw@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <CAEA6rAwhhxKRao8=aS3gj4O8JXXhpE33NAm6LvJXr3EjKE6Akw@mail.gmail.com>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Virus-Scanned: clamav-milter 0.98.4 at mail
X-Virus-Status: Clean
On Fri, 05 Sep 2014, Julian Andres Klode wrote:
> On Fri, Sep 5, 2014 at 10:21 AM, Julian Andres Klode <[email protected]> wrote:
> > On Fri, Sep 05, 2014 at 09:56:26AM +0200, Raphaël Hertzog wrote:
> >> Furthermore it would be nice if the configuration was loaded in a lazy
> >> way in all the apt.* modules. That would probably solve #728274.
> >
> > It would not, AFAICT. The thing with #728274 is that is a use case that
> > directly conflicts with another use case. One group of users like in the
> > bug report want to specify configuration files in the chroot, and others
> > are setting them outside the chroot (especially APT::Architecture for
> > foreign chroots).
> 
> Sorry, yes it actually would solve it in case you only create a single
> Cache(). Unfortunately, our configuration is a global thing, and thus
> the entries from the different root directory would remain even after
> the cache was closed; for example, when creating a new one.
> 
> It might make sense to provide the ability to switch apt_pkg.config
> between different Configuration instances (setting _config on the C++
> level), but I'm not sure if that would provide a consistent behaviour.
> 
> In short, global state sucks a lot, and there's not much we can do to fix it.

Well, you could at least avoid to initialize it before the user had a
chance to initialize it the way he want...

Hence the suggestion of lazy loading. It would not fix the case where
people want to use multiple configurations, but it would fix my use case
where I want a single configuration that is not polluted by the
system-wide configuration.

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Discover the Debian Administrator's Handbook:
→ http://debian-handbook.info/get/

Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Tue May 13 08:17:30 2025; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.