]> git.ipfire.org Git - thirdparty/psycopg.git/commit
fix: cache all dynamically generated adapter types 649/head
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Mon, 25 Sep 2023 15:19:53 +0000 (17:19 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Mon, 25 Sep 2023 23:03:55 +0000 (01:03 +0200)
commit4137dedad1e2e9078562bbb1ad5fff1b7ef640ed
treeff16c07e24b5f9337f61e7427e5a99c7d4652e30
parentd7eea4989766ea92b0d7d51559ff11779ff3b872
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.
psycopg/psycopg/types/composite.py
psycopg/psycopg/types/enum.py
psycopg/psycopg/types/hstore.py
psycopg/psycopg/types/json.py
psycopg/psycopg/types/multirange.py
psycopg/psycopg/types/range.py
psycopg/psycopg/types/shapely.py