[issue46256] Objects __del__ called after module have been removed

2022-01-06 Thread Christopher Vickery
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

[issue46256] Objects __del__ called after module have been removed

2022-01-05 Thread Christopher Vickery
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

[issue46256] Objects __del__ called after module have been removed

2022-01-04 Thread Christopher Vickery
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