[cx-oracle-users] bug in Cursor_Execute when keywordArgs is empty
Brought to you by:
atuining
From: Fabien G. <fab...@gr...> - 2006-03-11 08:22:31
|
Hello, I use cx_Oracle 4.1.2 with DBUtils. There was an error when I wanted to execute a query with a sequence parameter. For example, where 'cursor' is a cursor from a PooledDB connection: cursor.execute("select * from foo where login=:1", (['fabix'])) produced a cx_Oracle.InterfaceError in /usr/lib/python2.3/site-packages/DBUtils/SolidDB.py in tough_method(*args, **kwargs) line 243: --> r = method(*args, **kwargs) # try to execute I found the problem is passing kwargs whereas it's empty. I changed Cursor.c to solve it (from line 1276) : ---------- if (executeArgs && keywordArgs) { if (PyDict_Size(keywordArgs) > 0) { PyErr_SetString(g_InterfaceErrorException, "expecting argument or keyword arguments, not both"); return NULL; } } if (!executeArgs && keywordArgs) executeArgs = keywordArgs; ---------- Maybe someone else can be interested by this "patch". Regards, Fabien Grumelard |