Avoid printing the typecast name in debug statement

The way we were doing it is unsafe and causes assertion failures on Py3.

Fixes ticket #188

Conflicts:

	NEWS
This commit is contained in:
Daniele Varrazzo 2014-04-04 19:25:09 +01:00
parent 7faedd0a90
commit 7ed593504c
2 changed files with 4 additions and 3 deletions

2
NEWS
View File

@ -12,6 +12,8 @@ What's new in psycopg 2.4.7
Alexey Borzenkov (:ticket:`#173`).
- Manually creating `lobject` with the wrong parameter doesn't segfault
(:ticket:`#187`).
- Fixed unsafe access to object names causing assertion failures in
Python 3 debug builds (:ticket:`#188`).
- Avoid blocking async connections on connect (:ticket:`#194`). Thanks to
Adam Petrovich for the bug report and diagnosis.
- Fixed handling of dsn and closed attributes in connection subclasses

View File

@ -1101,9 +1101,8 @@ _pq_fetch_tuples(cursorObject *curs)
cast = psyco_default_cast;
}
Dprintf("_pq_fetch_tuples: using cast at %p (%s) for type %d",
cast, Bytes_AS_STRING(((typecastObject*)cast)->name),
PQftype(curs->pgres,i));
Dprintf("_pq_fetch_tuples: using cast at %p for type %d",
cast, PQftype(curs->pgres,i));
Py_INCREF(cast);
PyTuple_SET_ITEM(casts, i, cast);