From ac8c302b28d5778a48d41853006d8c6422b7766f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Fri, 11 Nov 2016 10:43:41 +0100 Subject: [PATCH] Make sure that svnlook outputs UTF8. Since we have an empty environment, svnlook defaults to ASCII, outputting {U+xxxx} instead of UTF8 characters. We can either re-interpret those, or just make sure we get UTF8 in the first place. --- notify_attract.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/notify_attract.py b/notify_attract.py index db05b31..8d6159c 100755 --- a/notify_attract.py +++ b/notify_attract.py @@ -10,6 +10,7 @@ Example call: """ import json +import os import os.path import subprocess import sys @@ -42,6 +43,9 @@ except KeyError: url = parse.urljoin(PILLAR_URL, '/attract/api/%s/subversion/log' % project_url) +# Make sure that svnlook outputs UTF8. Without this, since we have an empty environment, +# it defaults to ASCII, outputting {U+xxxx} instead of UTF8 characters. +os.environ['LANG'] = 'en_US.utf8' def svnlook(subcmd): info = subprocess.check_output(['/usr/bin/svnlook', subcmd, svn_repo, '-r', str(svn_revision)])