psycopg / psycopg2

PostgreSQL database adapter for the Python programming language
https://www.psycopg.org/
Other
3.35k stars 506 forks source link

module fails to initialize upon second import #1705

Closed zsalvet closed 4 months ago

zsalvet commented 4 months ago

I would like to reopen issue 1414... the problem stems from improper handling of static variables during repeated module initialization (we encountered it during Python interpreter reinitialization in OpenPBS server). Please see the patch attached... encodings_reinit_patch.txt

dvarrazzo commented 4 months ago

Fixing this bug is not on my roadmap. Psycopg 3 has been released and it is likely not affected by this problem.

If you want the bug fixed as a paid consultancy please get in touch privately.

Otherwise please make a MR with your changeset and also include a test in CI to show that it works as expected.