Debian Bug report logs - #526513
ImportError when using MySQLdb in embedded python

version graph

Package: python-mysqldb; Maintainer for python-mysqldb is Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>; Source for python-mysqldb is src:python-mysqldb.

Reported by: Phil Ashby <phil.ashby@bt.com>

Date: Fri, 1 May 2009 16:27:02 UTC

Severity: normal

Found in version python-mysqldb/1.2.2-7

Forwarded to https://sourceforge.net/tracker/?func=detail&aid=2795016&group_id=22307&atid=374932

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>:
Bug#526513; Package python-mysqldb. (Fri, 01 May 2009 16:27:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Phil Ashby <phil.ashby@bt.com>:
New Bug report received and forwarded. Copy sent to Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>. (Fri, 01 May 2009 16:27:04 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Phil Ashby <phil.ashby@bt.com>
To: submit@bugs.debian.org
Subject: ImportError when using MySQLdb in embedded python
Date: Fri, 01 May 2009 17:24:47 +0100
[Message part 1 (text/plain, inline)]
Package: python-mysqldb
Version: 1.2.2-7

On Debian GNU/Linux 5.0 (lenny). Python 2.5.2-3.

When python is embedded in a shared library (in my case a plugin), the
_mysql.so component of MySQLdb fails to load, due to this error:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: /var/lib/python-support/python2.5/_mysql.so: undefined
symbol: PyExc_ImportError

Discovered while trying to use the ida2sql.py script within IDAPython.

A simple example program is attached demonstrating the problem clearly,
this sample program also demonstrates a work-around, by setting the
RTLD_GLOBAL flag when loading the shared library, the necessary python
symbols are exported for _mysql.so and it loads correctly. Unfortunately
this isn't possible in my situation since IDA Pro is not open source,
and in general I think it's unwise for an application to export all the
symbols from any plugins it may load as there is a high probability of a
symbol collision.

I have also been able to work around this issue by re-linking _mysql.so
and including a direct dependancy on libpython2.5.so.1.0. This may not
be the right thing to do when using MySQLdb from the standard python
interpreter however?

[pymain.c (text/x-csrc, attachment)]
[pysql.c (text/x-csrc, attachment)]
[makefile (text/x-makefile, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>:
Bug#526513; Package python-mysqldb. (Wed, 20 May 2009 19:51:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Yonas <yonas.y@gmail.com>:
Extra info received and forwarded to list. Copy sent to Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>. (Wed, 20 May 2009 19:51:07 GMT) Full text and rfc822 format available.

Message #10 received at 526513@bugs.debian.org (full text, mbox):

From: Yonas <yonas.y@gmail.com>
To: 526513@bugs.debian.org
Subject: RE: ImportError when using MySQLdb in embedded python
Date: Wed, 20 May 2009 15:39:57 -0400
Hi Phil,

I'm getting this error, but with py-exim4-localscan.

Did you find a solution?

Thanks,
Yonas





Noted your statement that Bug has been forwarded to https://sourceforge.net/tracker/?func=detail&aid=2795016&group_id=22307&atid=374932. Request was from Jonas Meurer <mejo@debian.org> to control@bugs.debian.org. (Thu, 21 May 2009 19:09:05 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sun Apr 20 01:00:00 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.