hakril / PythonForWindows

A codebase aimed to make interaction with Windows and native execution easier
BSD 3-Clause "New" or "Revised" License
569 stars 114 forks source link

Bug while delete the process WinProcess: TypeError: super() argument 1 must be type, not None #37

Closed gogo2464 closed 2 years ago

gogo2464 commented 2 years ago

At the end of my program that uses an instance of WinProcess, I get this bug:

Exception ignored in: <function Process.del at 0x000001F608807160> Traceback (most recent call last): File "C:\Users\ME\Desktop\pwntools\venv\lib\site-packages\windows\winobject\process.py", line 513, in del TypeError: super() argument 1 must be type, not None

The line in question is super(Process, self).del() because the class process is already clened when deleted again.

I see a patch like:

if self is not None:
    super(Process, self).__del__()
hakril commented 2 years ago

Hi, Thank you for the issue, Given the error message I guess we should be checking that Process is not None instead of self is not None. But i would like to try to identify the cause of this, can you give me a way to reproduce the bug please ?