From: Daniele Varrazzo Date: Sat, 14 Nov 2020 22:22:47 +0000 (+0000) Subject: Transaction fixed after rebase on master X-Git-Tag: 3.0.dev0~351^2~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bdd91c028405c4c89fa27c9304879fe92e8dfea9;p=thirdparty%2Fpsycopg.git Transaction fixed after rebase on master --- diff --git a/psycopg3/psycopg3/transaction.py b/psycopg3/psycopg3/transaction.py index ee9921f96..4af553340 100644 --- a/psycopg3/psycopg3/transaction.py +++ b/psycopg3/psycopg3/transaction.py @@ -46,7 +46,9 @@ class Transaction: if savepoint_name is not None: if len(savepoint_name) == 0: raise ValueError("savepoint_name must be a non-empty string") - self._savepoint_name = connection.codec.encode(savepoint_name)[0] + self._savepoint_name = savepoint_name.encode( + connection.client_encoding + ) self.force_rollback = force_rollback self._outer_transaction: Optional[bool] = None @@ -59,7 +61,7 @@ class Transaction: def savepoint_name(self) -> Optional[str]: if self._savepoint_name is None: return None - return self._conn.codec.decode(self._savepoint_name)[0] + return self._savepoint_name.decode(self._conn.client_encoding) def __enter__(self) -> "Transaction": with self._conn.lock: