]> git.ipfire.org Git - thirdparty/psycopg.git/commit
Text dumping raises DataError if it contains a NUL byte
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Wed, 4 Nov 2020 01:17:44 +0000 (02:17 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Wed, 4 Nov 2020 17:02:13 +0000 (18:02 +0100)
commitc69d0efe59b3487c4a2e2bacb2daa5c19a39f2ee
tree4889572ff1361cc5713d70433a42cacb63edd4c8
parent97ed2cf385ff584ca0d3d6b8988eb9e3f11d7342
Text dumping raises DataError if it contains a NUL byte

Note that psycopg2 was raising ValueError, but DataError is more
appropriate. If the param is binary, Postgres will raise
.CharacterNotInRepertoire, which is a DataError subclass.
psycopg3/psycopg3/types/text.py
tests/types/test_text.py