From 8bbd21fa6a2d7215a4282e758ae8a4cac6ba4637 Mon Sep 17 00:00:00 2001 From: sqlcoder Date: Wed, 17 Jun 2009 23:05:20 +0100 Subject: [PATCH] hide error when a window has non UTF-8 char in title --- pyfpdb/Tables.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pyfpdb/Tables.py b/pyfpdb/Tables.py index 58da2690..5884e81e 100755 --- a/pyfpdb/Tables.py +++ b/pyfpdb/Tables.py @@ -231,7 +231,12 @@ def discover_nt_by_name(c, tablename): titles = {} win32gui.EnumWindows(win_enum_handler, titles) for hwnd in titles: - if not tablename in titles[hwnd]: continue + print "Tbales.py: tablename =", tablename, "title =", titles[hwnd] + try: + # this can blow up in XP on some windows, eg firefox displaying http://docs.python.org/tutorial/classes.html + if not tablename in titles[hwnd]: continue + except: + continue if 'History for table:' in titles[hwnd]: continue # Everleaf Network HH viewer window if 'HUD:' in titles[hwnd]: continue # FPDB HUD window if 'Chat:' in titles[hwnd]: continue # Some sites (FTP? PS? Others?) have seperable or seperately constructed chat windows