diff --git a/psycopg/diagnostics_type.c b/psycopg/diagnostics_type.c index fb0244ca..18223179 100644 --- a/psycopg/diagnostics_type.c +++ b/psycopg/diagnostics_type.c @@ -67,8 +67,7 @@ psyco_diagnostics_get_field(diagnosticsObject *self, void *closure) errortext = PQresultErrorField( ((cursorObject *)curs)->pgres, (Py_intptr_t) closure); if (errortext) { - // FIXME: does this need to use conn_text_from_chars()? - rv = PyString_FromString(errortext); + rv = conn_text_from_chars(((cursorObject *)curs)->conn, errortext); } exit: if (!rv) {