[python-win32] file descriptor issues using msvcrt.open_osfhandle()+os.fdopen()

Mark Hammond skippy.hammond at gmail.com
Mon Dec 19 22:32:59 CET 2011


On 18/12/2011 4:34 AM, Scott Leerssen wrote:
>
> On Dec 17, 2011, at 12:25 PM, Amaury Forgeot d'Arc wrote:
>
>> 2011/12/17 Scott Leerssen <sleerssen at gmail.com
>> <mailto:sleerssen at gmail.com>>
>>
>>     I did see that, but I interpreted that to mean that the PyHANDLE
>>     would be dereferenced from the underlying Windows file handle,
>>
>>
>> It's the other way round: the PyHandle just forgets the win32 handle
>> value, and will not close it in its __del__.
>
> Sorry, I did write that backward. How is the win32 handle freed?

The .Detach() method returns an integer handle value which can then be 
closed using win32api.CloseHandle().

Mark


More information about the python-win32 mailing list