[packages/iotop] - catch also ValueError in case when status has any line with unexpected format
kiesiu
kiesiu at pld-linux.org
Fri May 3 21:21:15 CEST 2013
commit 45e867c1a2d7f797d94bf1f52a4882ede8f3b8c8
Author: Łukasz Kieś <kiesiu at pld-linux.org>
Date: Fri May 3 21:19:05 2013 +0200
- catch also ValueError in case when status has any line with unexpected format
status-value-error.patch | 14 ++++++++++++++
1 file changed, 14 insertions(+)
---
diff --git a/status-value-error.patch b/status-value-error.patch
new file mode 100644
index 0000000..23171b6
--- /dev/null
+++ b/status-value-error.patch
@@ -0,0 +1,14 @@
+diff -uNr iotop-0.5.old/iotop/data.py iotop-0.5/iotop/data.py
+--- iotop-0.5.old/iotop/data.py 2013-02-03 19:50:02.000000000 +0100
++++ iotop-0.5/iotop/data.py 2013-05-03 21:11:06.116240158 +0200
+@@ -195,8 +195,8 @@
+ for line in open('/proc/%d/status' % pid):
+ key, value = line.split(':\t', 1)
+ result_dict[key] = value.strip()
+- except IOError:
+- pass # No such process
++ except (IOError, ValueError):
++ pass # No such process or unexpected line format in status file
+ return result_dict
+
+
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/iotop.git/commitdiff/10b384f3f2cca880acbaadce6f7566478d312531
More information about the pld-cvs-commit
mailing list