Fix ahi_hsd cleanup during interpreter shutdown#3303
Fix ahi_hsd cleanup during interpreter shutdown#3303sfinkens wants to merge 1 commit intopytroll:mainfrom
Conversation
|
Looking at the documentation, I don't see it clearly written that |
|
Yes, with finalizer the warnings are gone. Did you see that section in the documentation?
|
|
no, but I'm probably looking in the wrong place :) https://docs.python.org/3/reference/datamodel.html#object.__del__ |
|
Oh, sorry that's from https://docs.python.org/3/library/weakref.html#weakref.finalize |
|
Thanks for the link, I understand what finalize does here, so LGTM! I have to admit I'm a bit disappointed by |
I get the following warning when reading bzipped AHI HSD files
This is because the
osmodule is set to None during interpreter shutdown. From the docs:I followed the advice in the docs and registered the cleanup using
weakref.finalize.