Your message dated Sun, 03 Jun 2012 13:26:13 +0800
with message-id <1338701173.25093.1.camel@chianamo>
and subject line Re: Bug#670331: iotop: UnicodeEncodeError in ui.py
has caused the Debian Bug report #670331,
regarding iotop: UnicodeEncodeError in ui.py
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
670331: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=670331
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: iotop
Version: 0.4-2+squeeze1
Severity: normal
Tags: patch


I often run iotop something like

  nohup iotop -o -P -k -t -qqq >iotop.log 2>&1 &

but that sometimes fails and dies with:

Traceback (most recent call last):
  File "/usr/bin/iotop", line 16, in <module>
    main()
  File "/usr/lib/pymodules/python2.6/iotop/ui.py", line 556, in main
    main_loop()
  File "/usr/lib/pymodules/python2.6/iotop/ui.py", line 546, in <lambda>
    main_loop = lambda: run_iotop(options)
  File "/usr/lib/pymodules/python2.6/iotop/ui.py", line 451, in run_iotop
    return run_iotop_window(None, options)
  File "/usr/lib/pymodules/python2.6/iotop/ui.py", line 446, in run_iotop_window
    ui.run()
  File "/usr/lib/pymodules/python2.6/iotop/ui.py", line 126, in run
    self.process_list.duration)
  File "/usr/lib/pymodules/python2.6/iotop/ui.py", line 405, in refresh_display
    print l
UnicodeEncodeError: 'ascii' codec can't encode character u'\u221e' in position 
239: ordinal not in range(128)

I wonder if this could be "fixed" by changing ui.py and data.py :

--- ui.py.bak   2011-12-15 12:10:10.000000000 +1100
+++ ui.py       2012-04-25 07:27:31.000000000 +1000
@@ -428,12 +428,12 @@
             num_lines = min(len(lines), self.height - 2 - 
int(bool(status_msg)))
             for i in xrange(num_lines):
                 try:
-                    self.win.insstr(i + 2, 0, lines[i].encode('utf-8'))
+                    self.win.insstr(i + 2, 0, 
lines[i].encode('utf-8','ignore'))
                 except curses.error:
                     exc_type, value, traceback = sys.exc_info()
                     value = '%s win:%s i:%d line:%s' % \
                                        (value, self.win.getmaxyx(), i, 
lines[i])
-                    value = str(value).encode('string_escape')
+                    value = str(value).encode('string_escape','ignore')
                     raise exc_type, value, traceback
             if status_msg:
                 self.win.insstr(self.height - 1, 0, status_msg, curses.A_BOLD)
--- data.py.bak 2011-12-15 12:10:10.000000000 +1100
+++ data.py     2012-04-25 07:27:15.000000000 +1000
@@ -178,7 +178,7 @@
     try:
         return s.decode('utf-8')
     except UnicodeDecodeError:
-        return s.encode('string_escape')
+        return s.encode('string_escape','ignore')
 
 class ThreadInfo(DumpableObject):
     """Stats for a single thread"""


Thanks, Paul

Paul Szabo   [email protected]   http://www.maths.usyd.edu.au/u/psz/
School of Mathematics and Statistics   University of Sydney    Australia



-- System Information:
Debian Release: 6.0.4
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-pk05.12-x86 (SMP w/8 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash

Versions of packages iotop depends on:
ii  python [python-ctypes]  2.6.6-3+squeeze6 interactive high-level object-orie
ii  python-support          1.0.10           automated rebuilding support for P

iotop recommends no packages.

iotop suggests no packages.

-- no debconf information



--- End Message ---
--- Begin Message ---
Version: 0.4.4-1

On Sun, 2012-06-03 at 15:14 +1000, Paul Szabo wrote:

> I have installed the squeeze backports version 0.4.4-1~bpo60+1
> since mid-May, and have not had any failures yet: seems that this
> version solves my problem. I guess this bug may be closed.

Thanks, for testing, closing.

-- 
bye,
pabs

http://wiki.debian.org/PaulWise

Attachment: signature.asc
Description: This is a digitally signed message part


--- End Message ---

Reply via email to