]> git.ipfire.org Git - thirdparty/psycopg.git/commit
perf: drop call to pgconn_encoding per query
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Tue, 13 Dec 2022 05:19:05 +0000 (05:19 +0000)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Tue, 13 Dec 2022 11:22:50 +0000 (11:22 +0000)
commit39c575a545f722ee2285db31ee2ee2e4c94e8a37
treea7b79e08aa8ef010f04730816c931ca78a27abd9
parent880baa0e48f540a907c52bdc526a7222dcebb876
perf: drop call to pgconn_encoding per query

Cursor._encoding converted to property. It is only used in error
messages and infrequent operations.

Use uniformly the fallback value of utf-8 in *_encoding() functions,
especially when the connection is closed.
psycopg/psycopg/_encodings.py
psycopg/psycopg/cursor.py
tests/test_conninfo.py