Commits

Anonymous committed 63dc8b5

urwid: Fix bugs in [1674] (charset and --profile-display).

  • Participants
  • Parent commits a5bcbae

Comments (0)

Files changed (1)

hachoir-urwid/hachoir_urwid/urwid_ui.py

         try:
             fd = os.open(path, os.O_CREAT | os.O_EXCL | os.O_WRONLY)
         except OSError, err:
-            hachoir_log.error(str(err))
+            hachoir_log.error(unicode(str(err), self.charset))
         else:
             copyfileobj(InputFieldStream(self.focus.field).file(), os.fdopen(fd, 'w'))
 
                     if e == "window resize":
                         size = ui.get_cols_rows()
                         resize = log.height
-                        continue
-                    e = top.get_focus()[0].keypress(size[:1], e)
-                    if e is None:
-                        pass
-                    elif e == 'f1':
-                        try:
-                            body.select(body.tabs.index(help))
-                        except ValueError:
-                            body.append(help)
+                    else:
+                        e = top.get_focus()[0].keypress(size[:1], e)
+                        if e is None:
+                            pass
+                        elif e == 'f1':
+                            try:
+                                body.select(body.tabs.index(help))
+                            except ValueError:
+                                body.append(help)
+                                resize = log.height
+                        elif e in ('esc', 'ctrl w'):
+                            body.close()
+                            if body.box_widget is None:
+                                return
                             resize = log.height
-                    elif e in ('esc', 'ctrl w'):
-                        body.close()
-                        if body.box_widget is None:
+                        elif e == '+':
+                            if log.height:
+                                resize = log.height - 1
+                        elif e == '-':
+                            resize = log.height + 1
+                        elif e == 'q':
                             return
-                        resize = log.height
-                    elif e == '+':
-                        if log.height:
-                            resize = log.height - 1
-                    elif e == '-':
-                        resize = log.height + 1
-                    elif e == 'q':
-                        return
                 #except AssertionError:
                 #    hachoir_log.error(getBacktrace())
                 except NewTab_Stream, e: