[issue12085] subprocess.Popen.__del__ raises AttributeError if __init__ was called with an invalid argument list

Terry J. Reedy report at bugs.python.org
Sun Sep 15 07:47:37 CEST 2013


Terry J. Reedy added the comment:

The same issue arises when an exception is raised during the __init__ execution, rather than in the call argument match phase, and the exception is caught.

class C():
    def __init__(self): self.a = self.b
    def __del__(self): self.a

try:
    C()
except AttributeError): pass
# print same message as before about self.a in __del__

What is different is that if the exception raised within __init__ is not caught, only the normal traceback is printed.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12085>
_______________________________________


More information about the Python-bugs-list mailing list