changeset 432:8d03d7ada7e1

getan-eval.py: Fixes a possible encoding detection failure.
author Bernhard Reiter <bernhard@intevation.de>
date Tue, 30 May 2017 09:02:48 +0200
parents 8922713adbe6
children 266634f3712a
files CHANGES scripts/getan-eval.py
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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)
--- 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)
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)