[Python-modules-team] Bug#803944: python-mysqldb: MySQLdb.escape_string method fails

Fabien Harrang fabien at harrang.fr
Tue Nov 3 14:18:24 UTC 2015


Package: python-mysqldb
Version: 1.3.4-2.1
Severity: important

Dear Maintainer,

Since 1.3.4-2.1, MySQLdb.escape_string method fails.
Downgrading to 1.2.3-2.1, the method works again.

Example with 1.3.4-2.1:

   $ python -c 'import MySQLdb; print(MySQLdb.escape_string(b"foo"))'
   Traceback (most recent call last):
     File "<string>", line 1, in <module>
   TypeError: must be impossible<bad format char>, not str

   $ python -c 'import MySQLdb; print(MySQLdb.escape_string(u"foo"))'
   Traceback (most recent call last):
     File "<string>", line 1, in <module>
   TypeError: must be impossible<bad format char>, not unicode

The same with 1.2.3-2.1:

   $ python -c 'import MySQLdb; print(MySQLdb.escape_string(b"foo"))'
   foo

   $ python -c 'import MySQLdb; print(MySQLdb.escape_string(u"foo"))'
   foo

Here is the same issue by other people: 
https://github.com/PyMySQL/mysqlclient-python/issues/23
and a probable fix: 
https://github.com/PyMySQL/mysqlclient-python/commit/fae710dbfc3d3bcdc71aaef607ebd78f0b1a49d9

Thanks,

Fabien


-- System Information:
Debian Release: stretch/sid
   APT prefers testing
   APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.65-xenU-19-0e6777a-x86_64 (SMP w/1 CPU core)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages python-mysqldb depends on:
ii  libc6             2.19-22
ii  libmysqlclient18  5.6.25-4
ii  python            2.7.9-1
pn  python:any        <none>
ii  zlib1g            1:1.2.8.dfsg-2+b1

python-mysqldb recommends no packages.

Versions of packages python-mysqldb suggests:
ii  mysql-server              5.6.25-4
pn  python-egenix-mxdatetime  <none>
pn  python-mysqldb-dbg        <none>

-- no debconf information



More information about the Python-modules-team mailing list