[pywin32-bugs] [ pywin32-Bugs-3519214 ] Error handling in win32gui.GetClassName
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: SourceForge.net <no...@so...> - 2012-04-20 08:43:09
|
Bugs item #3519214, was opened at 2012-04-18 11:10 Message generated for change (Settings changed) made by rupole You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3519214&group_id=78018 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: win32 Group: None >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: David Nelson (dlnelson-logger) Assigned to: Nobody/Anonymous (nobody) Summary: Error handling in win32gui.GetClassName Initial Comment: When the handle passed to win32gui.GetClassName is invalid (perhaps because the window was previously destroyed), it calls PyWin_SetAPIError, but then returns the empty string (instead of NULL). This causes the exception to be raised some time later depending on the following code. At an interactive interpreter, I get: >>> win32gui.GetClassName(0) '' >>> pywintypes.error: (1400, 'GetClassName', 'Invalid window handle.') >>> At the second prompt, I just press enter. If pyreadline is installed, a full traceback from somewhere in pyreadline is printed immediately after the first line. I suspect the problem is in win32/src/win32gui.i on line 5999 (as of 6e918dcbc8c7), which should return PyWin_SetAPIError (or explicitly return NULL). ---------------------------------------------------------------------- >Comment By: Roger Upole (rupole) Date: 2012-04-20 01:43 Message: Fixed in changeset 4196. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3519214&group_id=78018 |