From b735326cf5250b114a5e0de3658879240d026826 Mon Sep 17 00:00:00 2001 From: Michael Ziegler Date: Tue, 23 Feb 2010 19:46:14 +0100 Subject: [PATCH] fix keyerror if LANG is unset and fallback to UTF8. --- pyweb/mucli.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyweb/mucli.py b/pyweb/mucli.py index 615b954..52d0fd7 100755 --- a/pyweb/mucli.py +++ b/pyweb/mucli.py @@ -107,10 +107,10 @@ else: if options.encoding is None: - locale = os.environ['LANG'] try: + locale = os.environ['LANG'] _, options.encoding = locale.split('.') - except ValueError: + except KeyError, ValueError: options.encoding = "UTF-8"