From: dvarrazzo (@dvarrazzo) <noreply+dvarrazzo@github.com>
To: psycopg/psycopg <noreply+psycopg-psycopg@github.com>
Subject: Re: [psycopg/psycopg] PR #1505: Decode JSON data using the connection encoding
Date: Thu, 19 Nov 2026 22:40:13 +0000
Message-ID: <gh-psycopg-psycopg-1505-rc4636070371@github.com> (raw)
In-Reply-To: <gh-psycopg-psycopg-1505@github.com>
References: <gh-psycopg-psycopg-1505@github.com>
(on psycopg/psycopg/types/json.py:268)
Please use the following, which is what we are currently using in other code:
```suggestion
return str(data, self._encoding)
```
this would actually also have the advantage of working with `memoryview`, so we wouldn't need the `bytes()` transformation and the if could be placed at the beginning of the function.