Deprecated module sets with python 2.6

Bug #341943 reported by Marco Rodrigues on 2009-03-12
50
This bug affects 5 people
Affects Status Importance Assigned to Milestone
MySQLdb
Invalid
Undecided
Unassigned
python-mysqldb (Debian)
Fix Released
Unknown
python-mysqldb (Ubuntu)
Low
Unassigned

Bug Description

Binary package hint: python-mysqldb

When used "import MySQLdb" in a python script.

/var/lib/python-support/python2.6/MySQLdb/__init__.py:34: DeprecationWarning: the sets module is deprecated
  from sets import ImmutableSet

Scott Kitterman (kitterman) wrote :

Should be reported upstream.

Changed in python-mysqldb:
importance: Undecided → Low
Changed in python-mysqldb:
status: Unknown → Fix Committed
Walter Huf (hufman) wrote :

The duplicate of this bug, #338387, says that version 1.2.3 of the python-mysqldb package will be out in March. It's now June, 3 months later, and I still have 1.2.2-7ubuntu1 installed. When will I get the updated, fixed version of this package?

mristroph (mristroph) wrote :

At the time of this writing, the Ubuntu package is still out of date, so it's still broken. To work around this, install MySQLdb using easy_install.

Here is what I did:

apt-get remove python-mysqldb # Remove outdated version
apt-get install python-setuptools # This package has easy_install, the tool you'll use to reinstall MySQLdb
### This might fail if you don't have some essentials. See below.
easy_install MySQL-python

### If you got an error about missing mysql_config, you'll need to install that. It's in libmysqlclient-dev
sudo aptitude search libmysqlclient # See what version of you are using. Assuming its 15, then do...
apt-get install libmysqlclient15-dev # Building MySQLdb will require mysql_config, in this package.
apt-get install python-dev # It'll also need Python.h and some other stuff in here
### If you have a really fresh system, you'll need all the regular build tools. Just for kicks, load up on these:
apt-get install binutils-doc gcc-multilib make manpages-dev autoconf automake1.9 libtool
# Now, this BETTER work
easy_install MySQL-python

Walter Huf (hufman) wrote :

Hello July! Still waiting on the new version of python-mysqldb, which would prevent my server from emailing me every day...

wdoekes (walter+ubuntu) wrote :

Walter Huf, in the mean time, you can add this to /var/lib/python-support/python2.6/MySQLdb/__init__.py (put it somewhere at the top):

import warnings
warnings.filterwarnings("ignore", message="the sets module is deprecated")

Or you could add it to the project that's mailing you every day.

Walter Huf (hufman) wrote :

I hacked the sets module itself to not throw the exception at all.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-mysqldb - 1.2.2-7ubuntu2

---------------
python-mysqldb (1.2.2-7ubuntu2) karmic; urgency=low

  * Add 07_python_2.6.dpatch to fix python 2.6 related warnings. (LP: #341943)

 -- Mario Limonciello <email address hidden> Sat, 15 Aug 2009 14:45:36 -0500

Changed in python-mysqldb (Ubuntu):
status: New → Fix Released
Changed in python-mysqldb (Debian):
status: Unknown → Fix Released
dino99 (9d9) wrote :

This version has expired

Changed in python-mysqldb:
importance: Unknown → Undecided
status: Fix Committed → New
status: New → Invalid
To post a comment you must log in.
This report contains Public information  Edit
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.