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,