[Python-Dev] try/except in io.py

Kristján Valur Jónsson kristjan at ccpgames.com
Fri Dec 19 22:00:29 CET 2008


Ok, in this case I move that we remove this try/except and see where it leads us.
If we see problems during teardown, we should deal with them in a more targeted manner.

Kristján

-----Original Message-----
From: Nick Coghlan [mailto:ncoghlan at gmail.com] 
Sent: 19. desember 2008 13:51
To: Kristján Valur Jónsson
Cc: Amaury Forgeot d'Arc; Python-Dev
Subject: Re: [Python-Dev] try/except in io.py


Generally speaking, close() and __delete__() methods that can be invoked
during interpreter shutdown should avoid referencing module globals at
all. Necessary globals (including members of other modules) should
either be cached on the relevant class or captured in a closure.

Now, it may be that the relevant close() method in io.py touches too
much code for that to be practical, but it certainly isn't the case in
general that encountering Name/Attribute/ImportError during shutdown is
inevitable.



More information about the Python-Dev mailing list