[egenix-users] mxODBC python dbapi compliance

M.-A. Lemburg mal at egenix.com
Mon Dec 20 20:35:00 CET 2004


Moof wrote:
> Hi there,
> I've just noticed that while mx.ODBC.Windows.apilevel == '2.0', it doesn't
> actually fulfil the spec as stated on PEP 249.
> 
> Specifically, it's lacking a threadsafety attribute. It has a threadlevel
> attribute which was in a draft of the spec, but applications that use it
> (I've been recently lookign at twisted.adbapi) will be expecting a
> threadsafety attribute.
> 
> Any chance of getting this corrected? Or am I going to have to purchase a
> support ticket for a one line modification?

Good catch :-) You are the first to notice in almost 5 years we
had that attribute in there !

We'll fix it in mxODBC 2.1.x which should be released early next year
and/or the next 2.0.x release - whichever happens earlier.

Until then, here's the diff to apply to all mxODBC.c copies in the
egenix-mx-commercial tree:

--- ../../../../egenix-mx-commercial-2.0.7/mx/ODBC/mxODBC/mxODBC.c      2003-04-30 
11:14:53.000000000+0200
+++ mxODBC.c    2004-12-20 20:32:11.110641549 +0100
@@ -6853,11 +6853,12 @@ MX_EXPORT(void)
      /* Bind method values */
      insint(moddict,"BIND_USING_PYTHONTYPE",MXODBC_BIND_USING_PYTHONTYPE);
      insint(moddict,"BIND_USING_SQLTYPE",MXODBC_BIND_USING_SQLTYPE);

      /* DB API 2.0 globals */
-    insint(moddict,"threadlevel",MXODBC_THREADLEVEL);
+    insint(moddict,"threadlevel",MXODBC_THREADLEVEL); /* deprecated ! */
+    insint(moddict,"threadsafety",MXODBC_THREADLEVEL);
      insstr(moddict,"apilevel",MXODBC_APILEVEL);
      insstr(moddict,"paramstyle","qmark");

      /* Type objects */
      Py_INCREF(&mxODBC_Type);

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Dec 20 2004)
 >>> Python/Zope Consulting and Support ...        http://www.egenix.com/
 >>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
 >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________
2004-12-06: Released eGenix mx Extensions for Python 2.4

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::



More information about the egenix-users mailing list