[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#723815: marked as done (python3-apt: aptsources.sourceslist.uniq(s) throws an exception in python3)



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 ---
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.

-- System Information:
Debian Release: 7.1
  APT prefers stable
  APT 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/dash

Versions of packages python3-apt depends on:
ii  libapt-inst1.5     0.9.7.9
ii  libapt-pkg4.12     0.9.7.9
ii  libc6              2.16-0experimental1
ii  libgcc1            1:4.7.2-5
ii  libstdc++6         4.7.2-5
ii  python-apt-common  0.8.8.2
ii  python3            3.2.3-6

Versions of packages python3-apt recommends:
ii  iso-codes    3.41-1
ii  lsb-release  4.1+Debian9

Versions of packages python3-apt suggests:
pn  python-apt-doc   <none>
pn  python3-apt-dbg  <none>

-- no debconf information


--
Jordan Metzmeier

--- End Message ---
--- Begin Message ---
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 ---

Reply to: