From 12fe7daf5ffa5f569b15284e411fb518d704a765 Mon Sep 17 00:00:00 2001 From: Paul Wise Date: Sun, 22 Aug 2010 15:08:08 +0800 Subject: [PATCH] Fix traceback with an invalid locale. Closes: http://bugs.debian.org/593846 --- iotop/ui.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/iotop/ui.py b/iotop/ui.py index c281ace..dab0b03 100644 --- a/iotop/ui.py +++ b/iotop/ui.py @@ -512,7 +512,10 @@ option, a to toggle the --accumulated option, q to quit, any other key to force a refresh.''' % sys.argv[0] def main(): - locale.setlocale(locale.LC_ALL, '') + try: + locale.setlocale(locale.LC_ALL, '') + except locale.Error: + print 'unable to set locale, falling back to the default locale' parser = optparse.OptionParser(usage=USAGE, version='iotop ' + VERSION) parser.add_option('-o', '--only', action='store_true', dest='only', default=False, -- 2.11.4.GIT