You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2016-09-12.02:43:11.820>created_at=<Date2011-03-22.22:15:42.956>labels= ['type-bug', 'library']
title='Shelve references globals in its __del__ method'updated_at=<Date2016-09-12.02:43:11.818>user='https://bugs.python.org/PeterDavies'
Shelf.__setitem__ (which is called from __del__ when writeback is enabled) references globals. This was causing exceptions on interpreter shutdown (due to another exception) for me.
I have attached a patch which stores the relevant globals in the Shelf object.
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.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: