summaryrefslogtreecommitdiff
path: root/psycopg/pqpath.c
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2016-12-26 12:25:13 +0100
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2016-12-26 12:25:13 +0100
commitf439ca61d678ed2fe34c132580cd6e8a581819f7 (patch)
tree6f375d62b78c53fbe6a37347be34d1163341d22b /psycopg/pqpath.c
parent7caba160b7083c64197329e17d0d0e0eb17c8639 (diff)
downloadpsycopg2-f439ca61d678ed2fe34c132580cd6e8a581819f7.tar.gz
conn->codec rename to pyenc
Diffstat (limited to 'psycopg/pqpath.c')
-rw-r--r--psycopg/pqpath.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/psycopg/pqpath.c b/psycopg/pqpath.c
index d02cb70..9dbd489 100644
--- a/psycopg/pqpath.c
+++ b/psycopg/pqpath.c
@@ -226,8 +226,8 @@ pq_raise(connectionObject *conn, cursorObject *curs, PGresult **pgres)
if (pyerr && PyObject_TypeCheck(pyerr, &errorType)) {
errorObject *perr = (errorObject *)pyerr;
- PyMem_Free(perr->codec);
- psycopg_strdup(&perr->codec, conn->codec, 0);
+ PyMem_Free(perr->pyenc);
+ psycopg_strdup(&perr->pyenc, conn->pyenc, 0);
Py_CLEAR(perr->pgerror);
perr->pgerror = error_text_from_chars(perr, err);
@@ -1332,8 +1332,8 @@ _pq_copy_in_v3(cursorObject *curs)
/* a file may return unicode if implements io.TextIOBase */
if (PyUnicode_Check(o)) {
PyObject *tmp;
- Dprintf("_pq_copy_in_v3: encoding in %s", curs->conn->codec);
- if (!(tmp = PyUnicode_AsEncodedString(o, curs->conn->codec, NULL))) {
+ Dprintf("_pq_copy_in_v3: encoding in %s", curs->conn->pyenc);
+ if (!(tmp = PyUnicode_AsEncodedString(o, curs->conn->pyenc, NULL))) {
Dprintf("_pq_copy_in_v3: encoding() failed");
error = 1;
break;
@@ -1488,7 +1488,7 @@ _pq_copy_out_v3(cursorObject *curs)
if (len > 0 && buffer) {
if (is_text) {
- obj = PyUnicode_Decode(buffer, len, curs->conn->codec, NULL);
+ obj = PyUnicode_Decode(buffer, len, curs->conn->pyenc, NULL);
} else {
obj = Bytes_FromStringAndSize(buffer, len);
}
@@ -1638,7 +1638,7 @@ retry:
Dprintf("pq_read_replication_message: >>%.*s<<", data_size, buffer + hdr);
if (repl->decode) {
- str = PyUnicode_Decode(buffer + hdr, data_size, conn->codec, NULL);
+ str = PyUnicode_Decode(buffer + hdr, data_size, conn->pyenc, NULL);
} else {
str = Bytes_FromStringAndSize(buffer + hdr, data_size);
}