]> git.ipfire.org Git - thirdparty/psycopg.git/log
thirdparty/psycopg.git
20 months agotest: fix test failing to connect if env vars are cleaned 683/head
Daniele Varrazzo [Tue, 21 Nov 2023 08:49:24 +0000 (09:49 +0100)] 
test: fix test failing to connect if env vars are cleaned

Add `dsn_env` fixture returning the `dsn` merged with the values in the
PG* env vars. This way the env can be cleaned but a working connection
string is still available.

20 months agofix: flush PG environment variables in test_connect{,_args}
Martin Weinelt [Tue, 21 Nov 2023 02:00:36 +0000 (03:00 +0100)] 
fix: flush PG environment variables in test_connect{,_args}

These tests were previously affected by environment variables, that can
be used to configure a postgresql instance.

Closes: #681
20 months agochore(ci): use existing macos11 packages in macOS arm build
Daniele Varrazzo [Fri, 17 Nov 2023 16:00:08 +0000 (17:00 +0100)] 
chore(ci): use existing macos11 packages in macOS arm build

20 months agochore: bump psycopg package version to 3.1.13 3.1.13
Daniele Varrazzo [Fri, 17 Nov 2023 15:36:57 +0000 (16:36 +0100)] 
chore: bump psycopg package version to 3.1.13

20 months agofix: plug memory leak receiving notifications in python libpq wrapper
Daniele Varrazzo [Thu, 16 Nov 2023 01:27:14 +0000 (02:27 +0100)] 
fix: plug memory leak receiving notifications in python libpq wrapper

Close #679.

20 months agoMerge branch 'fix-multiple-hosts-3.1' into maint-3.1
Daniele Varrazzo [Tue, 14 Nov 2023 00:24:17 +0000 (01:24 +0100)] 
Merge branch 'fix-multiple-hosts-3.1' into maint-3.1

20 months agochore: drop conninfo.resolve_hostaddr_async
Daniele Varrazzo [Mon, 13 Nov 2023 22:56:46 +0000 (23:56 +0100)] 
chore: drop conninfo.resolve_hostaddr_async

The function is no more used internally and only exposed from the _dns
module with a warning. Its implementation is now an application of a few
internal functions exposed internally by the conninfo module. Move the
whole implementation into _dns.

20 months agofix: add support for the 'load_balance_hosts' connection parameter
Daniele Varrazzo [Mon, 13 Nov 2023 20:12:45 +0000 (20:12 +0000)] 
fix: add support for the 'load_balance_hosts' connection parameter

20 months agotest: test conninfo attempts functions and multiple host support in connection
Daniele Varrazzo [Mon, 13 Nov 2023 18:08:51 +0000 (18:08 +0000)] 
test: test conninfo attempts functions and multiple host support in connection

20 months agofeat: explicitly iterate on multiple hosts on connections
Daniele Varrazzo [Thu, 26 Oct 2023 21:16:01 +0000 (23:16 +0200)] 
feat: explicitly iterate on multiple hosts on connections

The libpq async connection path doesn't iterate on the attempts, so we
need to do it ourselves.

20 months agorefactor: introduce support function to split connection attempts
Daniele Varrazzo [Thu, 26 Oct 2023 16:28:17 +0000 (18:28 +0200)] 
refactor: introduce support function to split connection attempts

Refactor the `resolve_hostaddr_async()` function to make use of such
facilities.

20 months agorefactor: move setting autocommit on connection out of _connect_gen
Daniele Varrazzo [Wed, 25 Oct 2023 18:23:08 +0000 (20:23 +0200)] 
refactor: move setting autocommit on connection out of _connect_gen

20 months agochore: bump min Python version tested with SQLAlchemy to 3.8
Daniele Varrazzo [Sat, 11 Nov 2023 19:49:24 +0000 (19:49 +0000)] 
chore: bump min Python version tested with SQLAlchemy to 3.8

20 months agochore: refresh 3rd party tests
Daniele Varrazzo [Sat, 11 Nov 2023 15:32:07 +0000 (15:32 +0000)] 
chore: refresh 3rd party tests

- upgrade Python to 3.12
- test stable version of SQLAlchemy 2
- add missing SQLAlchemy test dependency

Testing Django with Python 3.12 not enabled yet as it requires pylibmc wheel
packages for Python 3.12 (https://github.com/lericson/pylibmc/issues/288).

20 months agochore: bump psycopg_pool package version to 3.1.10.dev1
Daniele Varrazzo [Sat, 11 Nov 2023 19:10:28 +0000 (19:10 +0000)] 
chore: bump psycopg_pool package version to 3.1.10.dev1

20 months agochore: bump psycopg_pool package version to 3.1.9 pool-3.1.9
Daniele Varrazzo [Sat, 11 Nov 2023 19:04:30 +0000 (19:04 +0000)] 
chore: bump psycopg_pool package version to 3.1.9

20 months agofix(bump_version): fix bumping minor version with dev releases
Daniele Varrazzo [Sat, 11 Nov 2023 14:59:09 +0000 (14:59 +0000)] 
fix(bump_version): fix bumping minor version with dev releases

21 months agochore(macos): build images with more recent Python versions
Daniele Varrazzo [Thu, 2 Nov 2023 09:25:18 +0000 (10:25 +0100)] 
chore(macos): build images with more recent Python versions

21 months agoMerge branch 'fix-667-3.1' into maint-3.1
Daniele Varrazzo [Tue, 24 Oct 2023 18:15:18 +0000 (20:15 +0200)] 
Merge branch 'fix-667-3.1' into maint-3.1

21 months agofix: retry automatically syscall in wait_c if it fails with EINTR
Daniele Varrazzo [Tue, 24 Oct 2023 09:19:36 +0000 (11:19 +0200)] 
fix: retry automatically syscall in wait_c if it fails with EINTR

Fix #667

21 months agotest: add test to generate an EINTR in wait_c
Daniele Varrazzo [Tue, 24 Oct 2023 08:50:40 +0000 (10:50 +0200)] 
test: add test to generate an EINTR in wait_c

21 months agoMark test_identify_closure as timing-sensitive
Martin Weinelt [Mon, 23 Oct 2023 22:54:18 +0000 (00:54 +0200)] 
Mark test_identify_closure as timing-sensitive

```
____________________________ test_identify_closure _____________________________

conn_cls = <class 'psycopg.Connection'>, dsn = 'host=127.0.0.1 user=psycopg'

    @pytest.mark.crdb_skip("pg_terminate_backend")
    @pytest.mark.slow
    def test_identify_closure(conn_cls, dsn):
        def closer():
            time.sleep(0.2)
            conn2.execute("select pg_terminate_backend(%s)", [conn.pgconn.backend_pid])

        conn = conn_cls.connect(dsn)
        conn2 = conn_cls.connect(dsn)
        try:
            t = threading.Thread(target=closer)
            t.start()
            t0 = time.time()
            try:
                with pytest.raises(psycopg.OperationalError):
                    conn.execute("select pg_sleep(1.0)")
                t1 = time.time()
>               assert 0.2 < t1 - t0 < 0.4
E               assert 0.2 < (1697715164.8614173 - 1697715164.6617775)

tests/test_concurrency.py:231: AssertionError
```

21 months agodocs: link together readme files on PyPI and add reference to psycopg2
Daniele Varrazzo [Tue, 10 Oct 2023 21:21:57 +0000 (23:21 +0200)] 
docs: link together readme files on PyPI and add reference to psycopg2

See https://github.com/psycopg/psycopg2/issues/1632

21 months agostyle(pool): more explicit error message for pool open with no loop
Daniele Varrazzo [Sun, 8 Oct 2023 17:31:07 +0000 (19:31 +0200)] 
style(pool): more explicit error message for pool open with no loop

21 months agotest: mark array leak test slow
Daniele Varrazzo [Fri, 6 Oct 2023 19:37:17 +0000 (21:37 +0200)] 
test: mark array leak test slow

It takes 300ms, but it's still a blip when other tests run.

Add notes in the tests readme about repeating finding slow tests.

21 months agorefactor(pool): don't use a no-op function as reconnect callback
Daniele Varrazzo [Fri, 6 Oct 2023 15:04:42 +0000 (17:04 +0200)] 
refactor(pool): don't use a no-op function as reconnect callback

Just check for None.

21 months agostyle(pool): don't report too many decimals in timeout error message
Daniele Varrazzo [Fri, 6 Oct 2023 12:38:44 +0000 (14:38 +0200)] 
style(pool): don't report too many decimals in timeout error message

21 months agofix(pool): trade off usage timing precision for robustness
Daniele Varrazzo [Fri, 6 Oct 2023 12:36:43 +0000 (14:36 +0200)] 
fix(pool): trade off usage timing precision for robustness

It is unlikely that the statements we shuffled around will fail;
however, let's do the right thing and make sure that, if they do, the
getconn/putconn pair remains matched.

22 months agoMerge branch 'fix-652' into maint-3.1
Daniele Varrazzo [Tue, 3 Oct 2023 16:34:07 +0000 (18:34 +0200)] 
Merge branch 'fix-652' into maint-3.1

22 months agotest: verify that time objects with failing utcoffset() are handled correctly
Daniele Varrazzo [Tue, 3 Oct 2023 16:09:11 +0000 (18:09 +0200)] 
test: verify that time objects with failing utcoffset() are handled correctly

22 months agofix: raise DataError dumping a time with ambiguous timezone
Daniele Varrazzo [Tue, 3 Oct 2023 16:08:19 +0000 (18:08 +0200)] 
fix: raise DataError dumping a time with ambiguous timezone

Close #652

22 months agoMerge branch 'cp312-build' into maint-3.1
Daniele Varrazzo [Tue, 3 Oct 2023 11:29:48 +0000 (13:29 +0200)] 
Merge branch 'cp312-build' into maint-3.1

22 months agoci: add PostgreSQL 16 to the test grid
Daniele Varrazzo [Tue, 3 Oct 2023 11:26:16 +0000 (13:26 +0200)] 
ci: add PostgreSQL 16 to the test grid

22 months agotest: test Python 3.12 on all platform with final image
Daniele Varrazzo [Tue, 3 Oct 2023 11:21:46 +0000 (13:21 +0200)] 
test: test Python 3.12 on all platform with final image

22 months agoci: add Python 3.12 packages build
Daniele Varrazzo [Tue, 3 Oct 2023 11:19:35 +0000 (13:19 +0200)] 
ci: add Python 3.12 packages build

22 months agoci: build Python 3.12 packages
Daniele Varrazzo [Tue, 3 Oct 2023 08:48:40 +0000 (10:48 +0200)] 
ci: build Python 3.12 packages

22 months agochore: fix 'adapers' typo
Daniele Varrazzo [Tue, 3 Oct 2023 08:53:29 +0000 (10:53 +0200)] 
chore: fix 'adapers' typo

22 months agostyle: avoid a chained traceback on dns parsing error
Daniele Varrazzo [Wed, 27 Sep 2023 21:59:12 +0000 (23:59 +0200)] 
style: avoid a chained traceback on dns parsing error

22 months agofix: use Self type for connection pool in __*enter__()
Denis Laxalde [Wed, 5 Apr 2023 11:39:53 +0000 (13:39 +0200)] 
fix: use Self type for connection pool in __*enter__()

This makes inheritance, e.g. for *NullConnectionPool, work correctly:

    with psycopg_pool.NullConnectionPool() as p:
        pass
    reveal_type(p)
    # Revealed type is "psycopg_pool.null_pool.NullConnectionPool"

22 months agochore: bump psycopg package version to 3.1.13.dev1
Daniele Varrazzo [Wed, 27 Sep 2023 00:33:17 +0000 (02:33 +0200)] 
chore: bump psycopg package version to 3.1.13.dev1

22 months agochore: bump psycopg package version to 3.1.12 3.1.12
Daniele Varrazzo [Tue, 26 Sep 2023 21:25:55 +0000 (23:25 +0200)] 
chore: bump psycopg package version to 3.1.12

22 months agoMerge branch 'fix-608' into maint-3.1
Daniele Varrazzo [Tue, 26 Sep 2023 20:47:48 +0000 (22:47 +0200)] 
Merge branch 'fix-608' into maint-3.1

22 months agofix: use poll() instead of epoll() for waiting
Daniele Varrazzo [Tue, 26 Sep 2023 17:24:44 +0000 (19:24 +0200)] 
fix: use poll() instead of epoll() for waiting

epoll() hangs when the fd it listens to is closed. poll() doesn't have
this problem (as a consequence, hanging only happened in the Python
code, as wait_c is poll-based).

22 months agofix: don't hang forever if async connection is closed while querying
Daniele Varrazzo [Tue, 26 Sep 2023 16:29:47 +0000 (18:29 +0200)] 
fix: don't hang forever if async connection is closed while querying

Fix #608

22 months agofix: don't raise spurious errors on cancel if the connection is closed
Daniele Varrazzo [Tue, 26 Sep 2023 16:27:25 +0000 (18:27 +0200)] 
fix: don't raise spurious errors on cancel if the connection is closed

22 months agoci(scaleway_m1): add list command and jq pretty output
Daniele Varrazzo [Mon, 25 Sep 2023 15:16:02 +0000 (17:16 +0200)] 
ci(scaleway_m1): add list command and jq pretty output

22 months agochore(crdb): test 23.1 in CI
Daniele Varrazzo [Tue, 26 Sep 2023 16:54:10 +0000 (18:54 +0200)] 
chore(crdb): test 23.1 in CI

22 months agoMerge branch 'fix-647' into maint-3.1
Daniele Varrazzo [Tue, 26 Sep 2023 08:53:54 +0000 (10:53 +0200)] 
Merge branch 'fix-647' into maint-3.1

22 months agofix: cache all dynamically generated adapter types 649/head
Daniele Varrazzo [Mon, 25 Sep 2023 15:19:53 +0000 (17:19 +0200)] 
fix: cache all dynamically generated adapter types

These are not currently a leak in cPython, but I don't think it's
guaranteed anywhere, and it might well not be the case in other Python
implementations. So, as a matter of hygiene, make sure that calling
register_*() in a loop doesn't create an unbound number of new types.

22 months agofix: cache dynamic adapters created in register_array()
Daniele Varrazzo [Mon, 25 Sep 2023 22:26:56 +0000 (00:26 +0200)] 
fix: cache dynamic adapters created in register_array()

If the base class is a C extension, the subclasses cannot be GC'd. This
results in a leak if register_array() is called in a loop.

Close #647

22 months agochore: bump psycopg_pool package version to 3.1.9.dev1
Daniele Varrazzo [Sat, 23 Sep 2023 11:32:45 +0000 (13:32 +0200)] 
chore: bump psycopg_pool package version to 3.1.9.dev1

22 months agochore: bump psycopg package version to 3.1.12.dev1
Daniele Varrazzo [Sat, 23 Sep 2023 11:32:37 +0000 (13:32 +0200)] 
chore: bump psycopg package version to 3.1.12.dev1

22 months agochore: bump psycopg_pool package version to 3.1.8 3.1.11 pool-3.1.8
Daniele Varrazzo [Fri, 22 Sep 2023 22:08:43 +0000 (00:08 +0200)] 
chore: bump psycopg_pool package version to 3.1.8

22 months agochore: bump psycopg package version to 3.1.11
Daniele Varrazzo [Fri, 22 Sep 2023 22:08:01 +0000 (00:08 +0200)] 
chore: bump psycopg package version to 3.1.11

22 months agodocs: Document what to do when a new major version of Postgres is released
Daniele Varrazzo [Fri, 22 Sep 2023 21:44:42 +0000 (23:44 +0200)] 
docs: Document what to do when a new major version of Postgres is released

22 months agoci: provision a M1 build server automatically, if needed
Daniele Varrazzo [Fri, 22 Sep 2023 20:36:27 +0000 (22:36 +0200)] 
ci: provision a M1 build server automatically, if needed

22 months agochore: upgrade libpq, OpenSSL versions
Daniele Varrazzo [Fri, 22 Sep 2023 21:31:46 +0000 (23:31 +0200)] 
chore: upgrade libpq, OpenSSL versions

22 months agofix(bump_version): handle tagging without bumping version
Daniele Varrazzo [Fri, 22 Sep 2023 23:07:03 +0000 (01:07 +0200)] 
fix(bump_version): handle tagging without bumping version

22 months agoci: run 3rd party integration tests on commit on maint-3.1 branch
Daniele Varrazzo [Fri, 22 Sep 2023 22:23:07 +0000 (00:23 +0200)] 
ci: run 3rd party integration tests on commit on maint-3.1 branch

22 months agochore: update cibuildwheel version
Daniele Varrazzo [Fri, 22 Sep 2023 21:32:16 +0000 (23:32 +0200)] 
chore: update cibuildwheel version

22 months agochore: upgrade libpq, OpenSSL versions
Daniele Varrazzo [Fri, 22 Sep 2023 21:31:46 +0000 (23:31 +0200)] 
chore: upgrade libpq, OpenSSL versions

22 months agodocs: refresh stale release information
Daniele Varrazzo [Fri, 22 Sep 2023 21:23:47 +0000 (23:23 +0200)] 
docs: refresh stale release information

22 months agoperf(windows): don't use wait_c.
Daniele Varrazzo [Tue, 19 Sep 2023 20:38:03 +0000 (22:38 +0200)] 
perf(windows): don't use wait_c.

The function was reported to use excessive CPU. Need to investigate,
however, for the moment, suspend its usage on Windows.

See #645.

22 months agofix(c): fix loading of intervals with days and months or years
Daniele Varrazzo [Tue, 19 Sep 2023 19:07:20 +0000 (21:07 +0200)] 
fix(c): fix loading of intervals with days and months or years

Close #643.

22 months agoci: fix building Python 3.7 extension on windows using delvewheel 1.5.1
Daniele Varrazzo [Fri, 15 Sep 2023 15:35:58 +0000 (17:35 +0200)] 
ci: fix building Python 3.7 extension on windows using delvewheel 1.5.1

See https://github.com/adang1345/delvewheel/issues/39

22 months agostyle: move private functions closer to the classes where they are used
Daniele Varrazzo [Mon, 11 Sep 2023 00:54:02 +0000 (01:54 +0100)] 
style: move private functions closer to the classes where they are used

For better alignment with the master branch.

22 months agofix: avoid caching the parsing of large queries
Daniele Varrazzo [Mon, 4 Sep 2023 13:42:00 +0000 (14:42 +0100)] 
fix: avoid caching the parsing of large queries

These queries are typically generated by ORMs and have poor
cacheability, but can result in a lot of memory being used.

Close #628.

See also <https://github.com/sqlalchemy/sqlalchemy/discussions/10270>.

22 months agoRevert "chore(binary): bump depending libraries"
Daniele Varrazzo [Mon, 4 Sep 2023 14:03:24 +0000 (15:03 +0100)] 
Revert "chore(binary): bump depending libraries"

This reverts commit d424be88f63ee0d56088bcbc85904cdcc4fc48b8.

The commit only bumped the defaults in the build script, but actually
the proper version is in the workflow file. A libpq version fixing #528
was already released with psycopg-binary 3.1.10.

23 months agochore(binary): bump depending libraries
Daniele Varrazzo [Mon, 4 Sep 2023 00:16:35 +0000 (01:16 +0100)] 
chore(binary): bump depending libraries

Bump to libpq 15.4, OpenSSL 1.1.1v, OpenLDAP 2.6.6.

Particularly important is the libpq bump because the library, since
15.2, allows group access to the SSL certificate. See
https://github.com/psycopg/psycopg/discussions/528

23 months agochore: avoid anyio >= 4 for the moment
Daniele Varrazzo [Fri, 1 Sep 2023 10:46:01 +0000 (11:46 +0100)] 
chore: avoid anyio >= 4 for the moment

The 'policy' parameter is not supported anymore, and finding the right
workaround is tricky, especially because it's only needed for Windows,
and because anyio 4 doesn't support Python 3.7, so we would need to
support both the versions.

When we will drop Python 3.7 support it will be easier move to anyio >= 4.

23 months agoMerge branch 'fix-solaris' into maint-3.1
Daniele Varrazzo [Fri, 1 Sep 2023 12:33:46 +0000 (13:33 +0100)] 
Merge branch 'fix-solaris' into maint-3.1

23 months agodocs: mention fix for solaris build
Daniele Varrazzo [Fri, 1 Sep 2023 12:32:51 +0000 (13:32 +0100)] 
docs: mention fix for solaris build

23 months agofix: support solaris and deriv
Gaige B. Paulsen [Thu, 31 Aug 2023 11:40:44 +0000 (11:40 +0000)] 
fix: support solaris and deriv

23 months agofix: add missing pipeline sync in async cursro scroll().
Daniele Varrazzo [Sat, 19 Aug 2023 17:23:38 +0000 (18:23 +0100)] 
fix: add missing pipeline sync in async cursro scroll().

23 months agofix: add missing lock in async executemany with no pipeline
Daniele Varrazzo [Sat, 19 Aug 2023 17:23:38 +0000 (18:23 +0100)] 
fix: add missing lock in async executemany with no pipeline

23 months agoMerge branch 'fix-oid-overflow' into maint-3.1
Daniele Varrazzo [Fri, 1 Sep 2023 10:48:52 +0000 (11:48 +0100)] 
Merge branch 'fix-oid-overflow' into maint-3.1

23 months agodocs: add news entry about bug #630 fixed
Daniele Varrazzo [Wed, 23 Aug 2023 14:39:54 +0000 (15:39 +0100)] 
docs: add news entry about bug #630 fixed

23 months ago* fix integer overflow for oids > 2^31
David Grimes [Wed, 23 Aug 2023 13:37:50 +0000 (09:37 -0400)] 
* fix integer overflow for oids > 2^31

23 months agofix: rename QueuedLibpqWriter object
Daniele Varrazzo [Thu, 10 Aug 2023 00:37:22 +0000 (01:37 +0100)] 
fix: rename QueuedLibpqWriter object

It was mistakenly named Driver, not Writer.

23 months agofix: fix infinite loop and OOM in bad executemany
Daniele Varrazzo [Sat, 5 Aug 2023 21:15:05 +0000 (22:15 +0100)] 
fix: fix infinite loop and OOM in bad executemany

The bad condition is only reached using COPY into executemany in
pipeline mode and with prepared statements disabled. It should probably
never happen outside the unit test.

23 months agochore: bump psycopg package version to 3.1.11.dev1
Daniele Varrazzo [Sat, 5 Aug 2023 14:04:59 +0000 (15:04 +0100)] 
chore: bump psycopg package version to 3.1.11.dev1

23 months agochore: bump psycopg package version to 3.1.10 3.1.10
Daniele Varrazzo [Fri, 4 Aug 2023 14:55:12 +0000 (15:55 +0100)] 
chore: bump psycopg package version to 3.1.10

23 months agochore: upgrade cibuildwheel
Daniele Varrazzo [Fri, 4 Aug 2023 15:06:01 +0000 (16:06 +0100)] 
chore: upgrade cibuildwheel

23 months agochore: bump libpq, openssl used in binary packages
Daniele Varrazzo [Fri, 4 Aug 2023 15:02:29 +0000 (16:02 +0100)] 
chore: bump libpq, openssl used in binary packages

2 years agoMark two more tests as timing-sensitive
Martin Weinelt [Wed, 2 Aug 2023 01:59:23 +0000 (03:59 +0200)] 
Mark two more tests as timing-sensitive

FAILED tests/pool/test_pool_async.py::test_reconnect[asyncio] - AssertionError: [0.11509847640991211, 0.2041318416595459, 0.40631914138793945]
FAILED tests/pool/test_pool.py::test_reconnect - ValueError: the proxy didn't start listening in time

2 years agoMerge branch 'pipeline-nextset-warning' into maint-3.1
Daniele Varrazzo [Wed, 2 Aug 2023 00:03:28 +0000 (01:03 +0100)] 
Merge branch 'pipeline-nextset-warning' into maint-3.1

2 years agofix: raise a warning if nextset is used after execute in pipeline mode 613/head
Daniele Varrazzo [Tue, 1 Aug 2023 10:57:48 +0000 (11:57 +0100)] 
fix: raise a warning if nextset is used after execute in pipeline mode

So far have accumulated results, unlike in no-pipeline mode, where
results have been discarded. But this proved to be not reliable, so we
will forbid it in 3.2.

See #604

2 years agodocs: drop example about using nextset() in pipeline mode
Daniele Varrazzo [Tue, 1 Aug 2023 11:04:33 +0000 (12:04 +0100)] 
docs: drop example about using nextset() in pipeline mode

The feature is sort of accidental, not tested, and proved to be not
reliable, so we will remove it in 3.2.

See #604.

2 years agodocs: fix release version of json bytes dump support
Daniele Varrazzo [Tue, 1 Aug 2023 10:11:50 +0000 (11:11 +0100)] 
docs: fix release version of json bytes dump support

It is to be released in 3.1.10, not already released in 3.1.9... See #568

2 years agoMerge branch 'py312-3.1' into maint-3.1
Daniele Varrazzo [Tue, 1 Aug 2023 02:54:18 +0000 (03:54 +0100)] 
Merge branch 'py312-3.1' into maint-3.1

2 years agodocs: mention Python 3.12 support in news file
Daniele Varrazzo [Tue, 1 Aug 2023 02:48:52 +0000 (03:48 +0100)] 
docs: mention Python 3.12 support in news file

2 years agoci: bump Python 3.12 test version to beta 4
Daniele Varrazzo [Mon, 31 Jul 2023 23:56:51 +0000 (00:56 +0100)] 
ci: bump Python 3.12 test version to beta 4

2 years agotest: mark tests as failing to monitoring strange behaviour with Python 3.12
Daniele Varrazzo [Wed, 24 May 2023 23:09:09 +0000 (01:09 +0200)] 
test: mark tests as failing to monitoring strange behaviour with Python 3.12

With Python 3.12a7 and Cython-3.0.0b3, these two tests fails. It seems
that when an exception is involved the __del__ method is not called.

2 years agoci: set up test grid to test Python 3.12
Daniele Varrazzo [Wed, 24 May 2023 23:14:09 +0000 (01:14 +0200)] 
ci: set up test grid to test Python 3.12

2 years agochore: declare Python 3.12 supported in classifiers
Daniele Varrazzo [Wed, 24 May 2023 23:08:50 +0000 (01:08 +0200)] 
chore: declare Python 3.12 supported in classifiers

2 years agochore: upgrade Cython to stable 3.0.0
Daniele Varrazzo [Wed, 24 May 2023 23:08:26 +0000 (01:08 +0200)] 
chore: upgrade Cython to stable 3.0.0

2 years agofix: fix "can't adapt" error message on Python 3.11
Daniele Varrazzo [Mon, 31 Jul 2023 23:49:04 +0000 (00:49 +0100)] 
fix: fix "can't adapt" error message on Python 3.11

It appeared like "using placeholder '%PyFormat.TEXT'" because of the
change in the Enum display already fixed elsewhere.

Spotted in the conversation in #611.

Also fix unneeded nested exception in the Python version of the code.

2 years agofix: fix resetting read_only/deferrable to default using None
Daniele Varrazzo [Mon, 31 Jul 2023 22:52:45 +0000 (23:52 +0100)] 
fix: fix resetting read_only/deferrable to default using None

2 years agoMerge branch 'fix-591-3.1' into maint-3.1
Daniele Varrazzo [Mon, 24 Jul 2023 10:18:22 +0000 (11:18 +0100)] 
Merge branch 'fix-591-3.1' into maint-3.1

2 years agofix: fix possible errors calling __repr__ from __del__.
Daniele Varrazzo [Sun, 23 Jul 2023 19:33:05 +0000 (20:33 +0100)] 
fix: fix possible errors calling __repr__ from __del__.

The errors get ignored but print a warning on program exit and eclipse a
genuine warning.

The error is caused by the `pq.misc` module getting gc'd on interpreter
shutdown before `connection_summary()` is called. The solution is to
import `connection_summary` in the module namespace, which is similar to
the solution that proved working for #198. It is less robust than the
solution used by the Python devs to import the function in the method
via an argument default, but it should work adequately (as nobody
complained about #198 anymore).

In #591 discussion, I proposed that connection_summary is too complex to
be considered safe to call on __del__. Actually, looking at it, it seems
innocent enough, as it only calls objects methods, no functions from
module namespaces. As a consequence we assume that this commit fixes the
issue. As I can't reproduce it, will ask the OP if this is the case.

Close #591.