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
This commit is contained in:
Daniele Varrazzo 2014-04-04 19:25:09 +01:00
parent cefef286a6
commit a201307185
2 changed files with 4 additions and 3 deletions

2
NEWS
View File

@ -10,6 +10,8 @@ What's new in psycopg 2.5.3
Chris Withers (:ticket:`#193`).
- Avoid blocking async connections on connect (:ticket:`#194`). Thanks to
Adam Petrovich for the bug report and diagnosis.
- Fixed unsafe access to object names causing assertion failures in
Python 3 debug builds (:ticket:`#188`).
- Fixed handling of dsn and closed attributes in connection subclasses
failing to connect (from :ticket:`#192` discussion).
- Fixed overflow opening a lobject with an oid not fitting in a signed int

View File

@ -1134,9 +1134,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);