# HG changeset patch # User Bernhard Reiter # Date 1496127768 -7200 # Node ID 8d03d7ada7e1ac9c307613964294eb12e0becd02 # Parent 8922713adbe6af2d08cf185c74bf4403c082066d getan-eval.py: Fixes a possible encoding detection failure. diff -r 8922713adbe6 -r 8d03d7ada7e1 CHANGES --- a/CHANGES Tue May 30 09:01:12 2017 +0200 +++ b/CHANGES Tue May 30 09:02:48 2017 +0200 @@ -1,5 +1,8 @@ 2.1 xx.xx.20xx UNRELEASED + * Fixes a possible encoding detection failure: uses 'utf-8' by + default then. Patch by Tom Gottfried. (Bernhard Reiter) + * Improves how the 'user' is found: If no -u/--user is given uses the environment variable $USER or the string 'USER'. Patch by Tom Gottfried. (Bernhard Reiter) diff -r 8922713adbe6 -r 8d03d7ada7e1 scripts/getan-eval.py --- a/scripts/getan-eval.py Tue May 30 09:01:12 2017 +0200 +++ b/scripts/getan-eval.py Tue May 30 09:02:48 2017 +0200 @@ -49,7 +49,7 @@ template_name = options.template or "wochenbericht" if not options.encoding: - encoding = locale.getdefaultlocale()[1] + encoding = locale.getdefaultlocale()[1] or "utf-8" Writer = codecs.getwriter(encoding) sys.stdout = Writer(sys.stdout)