bpo-39672: shelve sigsegv crash by dorosch · Pull Request #18655 · python/cpython
https://bugs.python.org/issue39672
When the close method is not called while working with the shelve module and the program exits, the garbage collector calls the __delete__ method.
This method attempts to synchronize entries between the cache and disk. But because the garbage collector frees up resources, undefined behavior of the close method appears.