]> git.ipfire.org Git - thirdparty/psycopg.git/commit
fix: don't clobber a Python exception on COPY FROM with QueryCanceled 609/head
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Fri, 21 Jul 2023 01:10:01 +0000 (02:10 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Fri, 21 Jul 2023 19:51:03 +0000 (20:51 +0100)
commitbdd8d49971cc1a48d922ebca56416356248ee8b7
tree6ee754ce56c246dc9f736c21bd985cfafba9b331
parent44ae8e75b3d1f99d1c9c5609af4d626af521d473
fix: don't clobber a Python exception on COPY FROM with QueryCanceled

We trigger the server to raise the QueryCanceled; however, the original
exception has more information (the traceback). We can consider the
server exception just a notification that cancellation worked as
expected.

This is a mild change in behaviour, as the fixed tests state. However,
raising QueryCanceled is not explicitly documented and not part of a
strict interface, so we can probably change the exception raised without
needing to wait for psycopg 4.

Close #593
docs/news.rst
psycopg/psycopg/copy.py
tests/test_copy.py
tests/test_copy_async.py