Daniele Varrazzo added the comment:
Thank you @pablogsal. For me it was surprising as never seen before 3.10
instance.
If this is the expected behaviour (and the stdlib expects it) we can try and
take the same type of care in psycopg.
--
___
Pyth
Christopher Vickery added the comment:
This it very clear and totally consistent with the observed behavior. I can
think of a couple of workarounds for my app (move the db access from module
initialization to a function that gets invoked "on demand", or redirect
sys.stderr to /dev/null just
Pablo Galindo Salgado added the comment:
This doesn't look like a bug to me and is documented behavior:
https://docs.python.org/3/reference/datamodel.html#object.__del__
Check this paragraph:
Warning Due to the precarious circumstances under which __del__() methods are
invoked, exceptions t
Christopher Vickery added the comment:
The app has to open a db connection during module initialization to trigger the
problem, so I can't provide a self-contained way to reproduce the problem.
The closest I can come is the attached file, format_rules_annotated.py.
With lines 66-69 in place,
Dennis Sweeney added the comment:
I'm getting this:
Traceback (most recent call last):
File "/mnt/c/Users/sween/Source/Repos/cpython2/cpython/delbug.py", line 65,
in
conn = psycopg.connect('dbname=cuny_curriculum')
File "/home/sween/.local/lib/python3.10/site-packages/psycopg/connect
Christopher Vickery added the comment:
If the attached module is run with no command line arguments, it will reproduce
the problem without doing anything else. When run using Python 3.9 it does not
cause the problem. (This module comes from
https://github.com/cvickery/transfer-app, with an u
New submission from Daniele Varrazzo :
The following bug has been reported to Psycopg:
https://github.com/psycopg/psycopg/issues/198
At the end of the program, errors such as the following are dumped:
Exception ignored in:
Traceback (most recent call last):
File
"/opt/homebrew