[python-win32] unexpected exception during garbage collection

Mark Hammond mhammond@skippinet.com.au
Thu, 18 Apr 2002 13:30:20 +1000


> "Exception pywintypes.api_error: (6, 'CloseHandle', 'The handle
> is invalid.') in 'garbage collection' ignored
> Fatal Python error: unexpected exception during garbage collection

This is a problem with the PyHANDLE object interacting with the garbage
collector.  I have fixed it here, and the workaround would be to ensure you
manually call "handle.Close()" on all your handle objects before the garbage
collector runs.

Unfortunately the fix is in C++ code, so a simple patch is not really
possible.

Mark.