From 4172f12fb0a883aeac8d70d6ad1a50982b1d9ea1 Mon Sep 17 00:00:00 2001 From: Susanne Oberhauser Date: Mon, 6 Jul 2009 10:27:27 +0000 Subject: [PATCH] Work around funny python 2.6 default unicode unawareness to allow for unicode characters e.g. in submit request comments. --- osc-wrapper.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/osc-wrapper.py b/osc-wrapper.py index 26ebff10..7bbe8d18 100755 --- a/osc-wrapper.py +++ b/osc-wrapper.py @@ -3,7 +3,14 @@ # this wrapper exists so it can be put into /usr/bin, but still allows the # python module to be called within the source directory during development -import sys + +import sys, locale +# this is a hack to make osc work as expected with utf-8 characters, no matter +# how site.py is set... +reload(sys) +sys.setdefaultencoding(locale.getdefaultlocale()[1]) +del sys.setdefaultencoding + from osc import commandline from osc import babysitter