waliwali / ibm-db

Automatically exported from code.google.com/p/ibm-db
0 stars 0 forks source link

PyUnicode_FromObject sotimes failed #78

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Sometimes the PyUnicode_FromObject return NULL. 
We know but not understand why (if the string contain >127 char eg UTF-8).
But in that case the ibm-db 1.0.4 crash silently together with python. 

To raise readable exception I suggest modification in ibm_db.c line 4332 with 
inserting one if:
if (py_stmt != NULL && py_stmt != Py_None )

Original issue reported on code.google.com by kzsoltkz...@gmail.com on 26 Jul 2011 at 1:18

GoogleCodeExporter commented 9 years ago
Looks like the temp solution here is to pre encode the execute string to 
unicode. This can be as constant u'...' or with cmdstr.encode('utf-8') form. 
This skip the PyUnicode_FromObject.

Original comment by kzsoltkz...@gmail.com on 26 Jul 2011 at 7:43

GoogleCodeExporter commented 9 years ago

Original comment by rahul.pr...@in.ibm.com on 28 Jul 2011 at 10:09