Column names in copy methods can be unicode.

This commit is contained in:
Daniele Varrazzo 2010-12-30 01:15:47 +01:00
parent 73917c15e1
commit 89fb60de4b

View File

@ -1105,11 +1105,8 @@ static int _psyco_curs_copy_columns(PyObject *columns, char *columnlist)
columnlist[0] = '(';
while ((col = PyIter_Next(coliter)) != NULL) {
if (!Bytes_Check(col)) {
Py_DECREF(col);
if (!(col = psycopg_ensure_bytes(col))) {
Py_DECREF(coliter);
PyErr_SetString(PyExc_ValueError,
"elements in column list must be strings");
return -1;
}
Bytes_AsStringAndSize(col, &colname, &collen);