Bug 505611

Summary: Deprecation warning in MySQL-python
Product: [Fedora] Fedora Reporter: Georgi Hristozov <hristozov>
Component: MySQL-pythonAssignee: Tom Lane <tgl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 11CC: fschwarz, hhorak, iarlyy, ondrejj, rayvd, tgl
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 1.2.3-0.1.c1.fc11 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-07-03 19:53:48 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Georgi Hristozov 2009-06-12 15:16:53 UTC
Description of problem:
Importing MySQLdb triggers a warning:

/usr/lib/python2.6/site-packages/MySQLdb/__init__.py:34: DeprecationWarning: the sets module is deprecated
  from sets import ImmutableSet

Without additional effort, this makes the desired script unusable.

Version-Release number of selected component (if applicable):
Python 2.6.2
MySQL-python 1.2.2

How reproducible:
Always

Steps to Reproduce:
1. import MySQLdb
  
Actual results:
The above warning.

Expected results:
Clean import.

Comment 1 Felix Schwarz 2009-06-15 10:28:11 UTC
The fix is actually quite simple and non-intrusive and it has been fixed in upstream's 1.2 branch already: See upstream changesets r554, r558, r559, r603.

Are you (maintainers) willing to carry a fedora-specific patch which fixes DeprecationWarnings until 1.2.3 is released?

Comment 2 Georgi Hristozov 2009-06-15 10:40:01 UTC
I don't think a specific patch is needed. The 1.2.3c1 release works well with Python 2.6.

Comment 3 Felix Schwarz 2009-06-15 18:13:38 UTC
The question is if we want to ship a pre-release version of a software. MySQL-python has *long* release cycles (two years since the last stable release) so probably there are quite a lot of changes in 1.2.3 (which might break existing applications).

Comment 4 Georgi Hristozov 2009-06-15 18:34:18 UTC
If there were such epic changes it wouldn't be 1.2.3c1, but 1.3 or something (I don't know their versioning scheme). :) Just see the changelog. And don't forget that the things are already broken. I don't think that maintaining a patched version of the package is reasonable when there are mostly bugfixes in the release candidate. But let's leave it to the maintainer. :)

Comment 5 Tom Lane 2009-06-15 19:34:27 UTC
Surely a deprecation warning doesn't render the package "unusable"?

My inclination is to do nothing about this until 1.2.3 is released.  Judging from the timing of the betas it won't be very long now.

The numbering scheme that Andy has chosen precludes direct use of the release candidate version in Fedora.  (1.2.3c1 would be NVR-newer than 1.2.3, so updating from RC to final would fail.)  So the alternatives are to back-port or wait, and this doesn't seem important enough to back-port.

Comment 6 Jan ONDREJ 2009-06-19 12:16:21 UTC
I think, this should be fixed with a patch.

I have some scripts, which are started from cron and now produces unwanted output, because this warning is showed.

Also all warnings are disturbing, when developing an application. As an developer, I need to see all of them and fix them. Because this warning can't be fixed in my programs, it's disturbing too.

Patch to fix problem with MySQLdb is simple, so why to do not apply?

If you need a patch for current fedora release, just tell me, I can make and test it.

Comment 7 Felix Schwarz 2009-06-20 07:28:27 UTC
(In reply to comment #6)
You can filter the warning in your Python scripts using the warnings module:
import warnings
warnings.filterwarnings('ignore', '.*the sets module is deprecated.*', DeprecationWarning, 'MySQLdb')

This will suppress this specific warning from MySQLdb but you have to do it before you import MySQLdb.

Comment 8 Tom Lane 2009-06-28 16:57:43 UTC
Actually it turns out there is an approved method for putting release candidates into the RPM numbering sequence.  I am pushing MySQL-python-1.2.3-0.1.c1.fc11 into fedora-testing, please see if it works for you.

Comment 9 Fedora Update System 2009-06-28 17:00:23 UTC
MySQL-python-1.2.3-0.1.c1.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/MySQL-python-1.2.3-0.1.c1.fc11

Comment 10 Jan ONDREJ 2009-06-29 11:29:41 UTC
Works well for me. Thank you.

No warnings. Basic tests with my applications are good.

After this will be available in updates-testing, I can test this in some production servers.

Comment 11 Fedora Update System 2009-06-30 21:40:48 UTC
MySQL-python-1.2.3-0.1.c1.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update MySQL-python'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-7166

Comment 12 iarly selbir 2009-07-02 14:19:28 UTC
It was fixed for me with this last update

I added a comment on bodhi.

Thanks.

Comment 13 Fedora Update System 2009-07-03 19:53:34 UTC
MySQL-python-1.2.3-0.1.c1.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.