@@ -108,6 +108,7 @@ int pysqlite_statement_bind_parameter(pysqlite_Statement* self, int pos, PyObjec
Py_ssize_tbuflen;
PyObject*stringval;
parameter_typeparamtype;
char*c;
if(parameter==Py_None){
rc=sqlite3_bind_null(self->st,pos);
...
...
@@ -140,6 +141,17 @@ int pysqlite_statement_bind_parameter(pysqlite_Statement* self, int pos, PyObjec
paramtype=TYPE_UNKNOWN;
}
if(paramtype==TYPE_STRING&&!allow_8bit_chars){
string=PyString_AS_STRING(parameter);
for(c=string;*c!=0;c++){
if(*c&0x80){
PyErr_SetString(pysqlite_ProgrammingError,"You must not use 8-bit bytestrings unless you use a text_factory that can interpret 8-bit bytestrings (like text_factory = str). It is highly recommended that you instead just switch your application to Unicode strings.");
rc=-1;
gotofinal;
}
}
}
switch(paramtype){
caseTYPE_INT:
longval=PyInt_AsLong(parameter);
...
...
@@ -197,7 +209,7 @@ static int _need_adapt(PyObject* obj)