[issue11640] Shelve references globals in its __del__ method
report at bugs.python.org
Mon Aug 1 18:20:32 CEST 2011
Daniel Stutzbach <stutzbach at google.com> added the comment:
Could you add a comment above the lines defining self._BytesIO, describing why they're being set? Someone else might see them as unnecessary and rip them out if there's no explanation.
Can a test launch Python in a subprocess, set up the appropriate data structure, let the subprocess Python shutdown, then check the subprocess's stderr for the error?
It's a little convoluted, but perhaps it could be built into a general utility function that could be used to test __del__ methods in other modules, too.
Not sure that it's worth the effort though.
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list