[Python-modules-team] Bug#441559: python-mysqldb: incompatibility with python 2.4
Brieuc Jeunhomme
bbp at via.ecp.fr
Mon Sep 10 12:01:47 UTC 2007
Package: python-mysqldb
Version: 1.2.1-p2-4
Severity: important
Hello,
after an update from woody to sarge, some of the scripts using
python-mysqldb stopped working, raising exceptions in code that used to
work.
The Str2Set function from this package
(/usr/lib/python2.4/site-packages/MySQLdb/converters.py) is the
following:
def Str2Set(s):
values = s.split(',')
return apply(str, tuple(values))
I am unsure whether this used to work or not, but, reading the python
documentation, this is not expected to work. I replaced
apply(str, tuple(values))
by
tuple( map( str, values ) )
and my scripts worked again.
I looked for this file in the original mysqldb from sourceforge, and it
seems the version supplied in the Debian package is very different from
the file from the original package.
I finally replaced the implementation of Str2Set with the implementation
from sourceforge, and things also work fine :
def Str2Set(s):
values = s.split(',')
return Set([ i for i in s.split(',') if i ])
However, the soureforge file differs much more than this, maybe an
update is required ?
-- System Information:
Debian Release: 4.0
APT prefers stable
APT policy: (500, 'stable')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.22.6
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
More information about the Python-modules-team
mailing list