mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-02-21 11:10:32 +03:00
Column names in copy methods can be unicode.
This commit is contained in:
parent
73917c15e1
commit
89fb60de4b
|
@ -1105,11 +1105,8 @@ static int _psyco_curs_copy_columns(PyObject *columns, char *columnlist)
|
||||||
columnlist[0] = '(';
|
columnlist[0] = '(';
|
||||||
|
|
||||||
while ((col = PyIter_Next(coliter)) != NULL) {
|
while ((col = PyIter_Next(coliter)) != NULL) {
|
||||||
if (!Bytes_Check(col)) {
|
if (!(col = psycopg_ensure_bytes(col))) {
|
||||||
Py_DECREF(col);
|
|
||||||
Py_DECREF(coliter);
|
Py_DECREF(coliter);
|
||||||
PyErr_SetString(PyExc_ValueError,
|
|
||||||
"elements in column list must be strings");
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
Bytes_AsStringAndSize(col, &colname, &collen);
|
Bytes_AsStringAndSize(col, &colname, &collen);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user