/usr/bin/lsb_release:81: DeprecationWarning: the sets module is deprecated

Bug #336436 reported by Anders Kaseorg
30
Affects Status Importance Assigned to Milestone
lsb (Debian)
Fix Released
Undecided
Unassigned
lsb (Ubuntu)
Fix Released
Low
Colin Watson

Bug Description

Binary package hint: lsb-release

After the recent Python 2.6 transition, running lsb_release in Jaunty with any options yields a warning on stderr:

$ lsb_release -a
/usr/bin/lsb_release:81: DeprecationWarning: the sets module is deprecated
  import sets
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu jaunty (development branch)
Release: 9.04
Codename: jaunty

Related branches

Revision history for this message
Anders Kaseorg (andersk) wrote :

Confirming from duplicate.

Changed in lsb:
status: New → Confirmed
Revision history for this message
Anders Kaseorg (andersk) wrote :

Here’s a debdiff to replace the deprecated Python sets module with the builtin set type, which works in python >= 2.4 and doesn’t spew warnings on 2.6.

Revision history for this message
Anders Kaseorg (andersk) wrote :

This is built in my PPA, and confirmed working:
<https://launchpad.net/~anders-kaseorg/+archive/ppa>

Revision history for this message
Colin Watson (cjwatson) wrote :

I know python 2.3 isn't particularly important any more, but I still hate breaking compatibility when it's easy not to (particularly since you didn't change dependencies or anything to indicate the new requirement). How about this:

try:
    set # introduced in 2.4
except NameError:
    import sets
    set = sets.Set

... and then just use 'set' instead of 'sets.Set' in the rest of the program?

Changed in lsb:
assignee: nobody → cjwatson
importance: Undecided → Low
Revision history for this message
Anders Kaseorg (andersk) wrote :

Reasonable. Here’s a debdiff to do that instead.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lsb - 3.2-20ubuntu4

---------------
lsb (3.2-20ubuntu4) jaunty; urgency=low

  * Replace the deprecated Python sets module with the builtin set type,
    if it is available (python >= 2.4), to avoid spewing warnings for
    python >= 2.6. (LP: #336436)

 -- Anders Kaseorg <email address hidden> Mon, 02 Mar 2009 03:35:14 -0500

Changed in lsb:
status: Confirmed → Fix Released
Changed in lsb:
status: Unknown → New
Revision history for this message
Mark Greenwood (fatgerman) wrote :

Just tested on Jaunty with all updates and I can confirm the fix.

Revision history for this message
Artur Rona (ari-tczew) wrote :

 lsb (3.2-21) unstable; urgency=low

   * Provide lsb_release module for Python applications. (Closes: #486262)
   * Change working directory to $PWD in start-stop-daemon, for better
     compatibility with LSB applications. (Closes: #519817)
   * return 3 rather than 4 in pidofproc if a PID file is specified and
     the daemon is not found. (Closes: #494623)
   * Improve handling of future testing versions unknown to lsb-release.
     Patch by Jan Muszynski (Closes: #517594).
   * Fix DeprecationWarning with Python 2.6; patch from Colin Watson and
     Anders Kaseorg. (Closes: #517819)
   * Bypass guess_debian_release() if /etc/lsb-release is complete.
     Patch from Scott James Remnant. (Closes: #511952)
   * 'time' was missing from lsb-core dependencies. (Closes: #510488)
   * Demote lsb to a suggestion by lsb-release. (Closes: #509611)

 -- Chris Lawrence <email address hidden> Thu, 19 Mar 2009 16:29:25 -0500

Changed in lsb (Debian):
importance: Unknown → Undecided
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.