Menu

#203 win32gui.EnumChildWindows() crashes when no children

closed-wont-fix
nobody
None
5
2005-04-12
2005-03-22
ingesson
No

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.

Discussion

  • Mark Hammond

    Mark Hammond - 2005-04-12

    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.

     
  • Mark Hammond

    Mark Hammond - 2005-04-12
    • status: open --> closed-wont-fix