Package: python-mysqldb
Version: 1.2.2-7ubuntu2
Severity: normal
Tags: patch

When using python-mysqldb on python 2.6, there is a couple of warnings
that will be output to the terminal.

These are fixed upstream: http://sourceforge.net/support/tracker.php?aid=2156977

-- System Information:
Debian Release: 5.0
  APT prefers jaunty-updates
  APT policy: (500, 'jaunty-updates'), (500, 'jaunty-security'), (500, 
'jaunty-backports'), (500, 'jaunty')
Architecture: i386 (i686)

Kernel: Linux 2.6.28-13-generic (SMP w/2 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 python-mysqldb depends on:
ii  libc6     2.9-4ubuntu6                   GNU C Library: Shared libraries
ii  libmysqlc 5.1.30really5.0.75-0ubuntu10.2 MySQL database client library
ii  python    2.6.2-0ubuntu1                 An interactive high-level object-o
ii  python-su 0.8.7ubuntu4                   automated rebuilding support for P

python-mysqldb recommends no packages.

Versions of packages python-mysqldb suggests:
ii  mysql-ser 5.1.30really5.0.75-0ubuntu10.2 MySQL database server (metapackage
ii  mysql-ser 5.1.30really5.0.75-0ubuntu10.2 MySQL database server binaries
pn  python-eg <none>                         (no description available)
pn  python-my <none>                         (no description available)

-- no debconf information
diff -Nru python-mysqldb-1.2.2/debian/changelog python-mysqldb-1.2.2/debian/changelog
--- python-mysqldb-1.2.2/debian/changelog	2009-08-15 15:00:53.000000000 -0500
+++ python-mysqldb-1.2.2/debian/changelog	2009-08-15 15:00:54.000000000 -0500
@@ -1,3 +1,9 @@
+python-mysqldb (1.2.2-9) UNRELEASED; urgency=low
+
+  * Add 07_python_2.6.dpatch to fix python 2.6 related warnings.
+
+ -- Mario Limonciello <supe...@ubuntu.com>  Sat, 15 Aug 2009 14:59:53 -0500
+
 python-mysqldb (1.2.2-8) unstable; urgency=low
 
   [ Sandro Tosi ]
diff -Nru python-mysqldb-1.2.2/debian/patches/00list python-mysqldb-1.2.2/debian/patches/00list
--- python-mysqldb-1.2.2/debian/patches/00list	2009-08-15 15:00:53.000000000 -0500
+++ python-mysqldb-1.2.2/debian/patches/00list	2009-08-15 15:00:54.000000000 -0500
@@ -3,3 +3,4 @@
 04_disable_ez_setup
 05_null-connection-guard
 06_mysql_connect_port
+07_python_2.6.dpatch
diff -Nru python-mysqldb-1.2.2/debian/patches/07_python_2.6.dpatch python-mysqldb-1.2.2/debian/patches/07_python_2.6.dpatch
--- python-mysqldb-1.2.2/debian/patches/07_python_2.6.dpatch	1969-12-31 18:00:00.000000000 -0600
+++ python-mysqldb-1.2.2/debian/patches/07_python_2.6.dpatch	2009-08-15 15:00:54.000000000 -0500
@@ -0,0 +1,75 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 07_python_2.6.dpatch by  <supe...@ubuntu.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Cherry pick upstream 554 & 603 to fix python 2.6 support
+
+...@dpatch@
+diff -urNad python-mysqldb-1.2.2~/MySQLdb/__init__.py python-mysqldb-1.2.2/MySQLdb/__init__.py
+--- python-mysqldb-1.2.2~/MySQLdb/__init__.py	2007-02-26 13:00:32.000000000 -0600
++++ python-mysqldb-1.2.2/MySQLdb/__init__.py	2009-08-15 14:48:10.000000000 -0500
+@@ -19,8 +19,8 @@
+ import _mysql
+ 
+ if version_info != _mysql.version_info:
+-    raise ImportError, "this is MySQLdb version %s, but _mysql is version %r" %\
+-          (version_info, _mysql.version_info)
++    raise ImportError("this is MySQLdb version %s, but _mysql is version %r" %
++                      (version_info, _mysql.version_info))
+ 
+ threadsafety = 1
+ apilevel = "2.0"
+@@ -31,25 +31,20 @@
+ from MySQLdb.times import Date, Time, Timestamp, \
+     DateFromTicks, TimeFromTicks, TimestampFromTicks
+ 
+-from sets import ImmutableSet
+-class DBAPISet(ImmutableSet):
++try:
++    frozenset
++except NameError:
++    from sets import ImmutableSet as frozenset
++
++class DBAPISet(frozenset):
+ 
+     """A special type of set for which A == x is true if A is a
+     DBAPISet and x is a member of that set."""
+ 
+-    def __ne__(self, other):
+-        from sets import BaseSet
+-        if isinstance(other, BaseSet):
+-            return super(DBAPISet.self).__ne__(self, other)
+-        else:
+-            return other not in self
+-
+     def __eq__(self, other):
+-        from sets import BaseSet
+-        if isinstance(other, BaseSet):
+-            return super(DBAPISet, self).__eq__(self, other)
+-        else:
+-            return other in self
++        if isinstance(other, DBAPISet):
++            return not self.difference(other)
++        return other in self
+ 
+ 
+ STRING    = DBAPISet([FIELD_TYPE.ENUM, FIELD_TYPE.STRING,
+@@ -65,6 +60,18 @@
+ DATETIME  = TIMESTAMP
+ ROWID     = DBAPISet()
+ 
++def test_DBAPISet_set_equality():
++    assert STRING == STRING
++
++def test_DBAPISet_set_inequality():
++    assert STRING != NUMBER
++
++def test_DBAPISet_set_equality_membership():
++    assert FIELD_TYPE.VAR_STRING == STRING
++
++def test_DBAPISet_set_inequality_membership():
++    assert FIELD_TYPE.DATE != STRING
++
+ def Binary(x):
+     return str(x)
+ 
_______________________________________________
Python-modules-team mailing list
Python-modules-team@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/python-modules-team

Reply via email to