win32gui.EnumChildWindows() crashes when no children
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
When the method win32gui.EnumChildWindows(hwnd,
callback, extra) finds the window for which to return
children but the window doesn't have any children it
crashes with the error: "pywintypes.error: (0,
'EnumChildWindows', 'No error message is available')".
The correct behavior should be to return a empty list.
However as Mark has pointed out on python-win32 mail
list this may be an unsafe change for already written
code expecting an exception if a empty list is returned
instead. In which case, at least an exception with a
error description should be thrown.
Logged In: YES
user_id=14198
I don't think this should be fixed. The underlying API
function is indeed returning FALSE, so we report that as an
exception. As it is not our error detection logic which is
at fault, there isn't anything to fix.