#25 Copy converters when connection created

MySQLdb (53)

When the internal converters dictionary in MySQLdb is
used a copy of the dictionary is used. When an
external dictionary is passed upon connection creation,
a copy is not made.

This patch makes a copy of an the external dictionary
when the connection is created. This prevents
premature garbage collection of objects that are weakly
referenced in the MySQLdb code.

Patch was created with:

diff -ur MySQL-python-1.2.0 MySQL-python-1.2.0_hacked/ > \ copy_incoming_converters.patch

Should be able to apply it with patch -p1 <

Hopefully this patch will help others not encounter the
same problem that we did - we made a copy of the
MySQLdb converters dictionary, modified it and then
passed it into every new connection - with intermittent
problems that has taken us about 6 months to track down.

Hope this helps,

Jerry Seutter


  • Jerry Seutter

    Jerry Seutter - 2005-04-22

    Patch to make a copy of the converter dictionary passed into connection constructor.

  • Andy Dustman

    Andy Dustman - 2005-04-30

    Logged In: YES

    Your patch, or a variation, has been applied to the current CVS tree.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks