Your message dated Tue, 8 Oct 2013 23:42:52 +0200 with message-id <20131008201655.GA9764@debian.org> and subject line Re: Bug#723815: python3-apt: aptsources.sourceslist.uniq(s) throws an exception in python3 has caused the Debian Bug report #723815, regarding python3-apt: aptsources.sourceslist.uniq(s) throws an exception in python3 to be marked as done. This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the Bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what this message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact owner@bugs.debian.org immediately.) -- 723815: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=723815 Debian Bug Tracking System Contact owner@bugs.debian.org with problems
--- Begin Message ---
- To: submit@bugs.debian.org
- Subject: python3-apt: aptsources.sourceslist.uniq(s) throws an exception in python3
- From: Jordan Metzmeier <titan8990@gmail.com>
- Date: Thu, 19 Sep 2013 21:55:26 -0500
- Message-id: <CAD758RitCTF_rb1Y2ner2Jx85okW73bkaQci6LBJ0ATbAjrmqg@mail.gmail.com>
Package: python3-aptVersion: 0.8.9.1+b1Severity: normalTags: upstreamDear Maintainer,The uniq() method seems to call set() which does not work with SourcesList objects in python3. The following exception is thrown:Traceback (most recent call last):File "./apt-provides", line 10, in <module>for line in aptsources.sourceslist.uniq(aptsources.sourceslist.SourcesList()):File "/usr/lib/python3/dist-packages/aptsources/sourceslist.py", line 76, in uniqreturn list(set(s))TypeError: unhashable type: 'SourceEntry'This was also tested on version 0.8.9.1+b1. The same code works in the python2 version.-- System Information:Debian Release: 7.1APT prefers stableAPT policy: (500, 'stable'), (1, 'experimental')Architecture: i386 (i686)Kernel: Linux 3.2.0-4-686-pae (SMP w/4 CPU cores)Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)Shell: /bin/sh linked to /bin/dashVersions of packages python3-apt depends on:ii libapt-inst1.5 0.9.7.9ii libapt-pkg4.12 0.9.7.9ii libc6 2.16-0experimental1ii libgcc1 1:4.7.2-5ii libstdc++6 4.7.2-5ii python-apt-common 0.8.8.2ii python3 3.2.3-6Versions of packages python3-apt recommends:ii iso-codes 3.41-1ii lsb-release 4.1+Debian9Versions of packages python3-apt suggests:pn python-apt-doc <none>pn python3-apt-dbg <none>-- no debconf information--
Jordan Metzmeier
--- End Message ---
--- Begin Message ---
- To: Jordan Metzmeier <titan8990@gmail.com>, 723815-close@bugs.debian.org
- Subject: Re: Bug#723815: python3-apt: aptsources.sourceslist.uniq(s) throws an exception in python3
- From: Julian Andres Klode <jak@debian.org>
- Date: Tue, 8 Oct 2013 23:42:52 +0200
- Message-id: <20131008201655.GA9764@debian.org>
- In-reply-to: <CAD758RitCTF_rb1Y2ner2Jx85okW73bkaQci6LBJ0ATbAjrmqg@mail.gmail.com>
- References: <CAD758RitCTF_rb1Y2ner2Jx85okW73bkaQci6LBJ0ATbAjrmqg@mail.gmail.com>
On Thu, Sep 19, 2013 at 09:55:26PM -0500, Jordan Metzmeier wrote: > Package: python3-apt > Version: 0.8.9.1+b1 > Severity: normal > Tags: upstream > > Dear Maintainer, > > The uniq() method seems to call set() which does not work with SourcesList > objects in python3. The following exception is thrown: > > Traceback (most recent call last): > > File "./apt-provides", line 10, in <module> > > for line in > aptsources.sourceslist.uniq(aptsources.sourceslist.SourcesList()): > > File "/usr/lib/python3/dist-packages/aptsources/sourceslist.py", line 76, > in uniq > return list(set(s)) > > TypeError: unhashable type: 'SourceEntry' > > This was also tested on version 0.8.9.1+b1. The same code works in the > python2 version. > It shouldn't. The uniq function is a helper function for Python's list() type, not for a SourcesList. It seems intented for internal use only. While we could add a __hash__ method to SourceEntry, doing so would make it bad Python code -- the object is mutable, and mutable objects should not have a __hash__ method. I documented this in git, and made the uniq function invisible to normal use (by not including it in __all__) and tagged this bug as pending. -- Julian Andres Klode - Debian Developer, Ubuntu Member See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.
--- End Message ---