Browse code

support python-2.6 again, whose open() function does not have encoding-parameter by default

Bernd Wurst authored on24/02/2014 17:29:23
Showing1 changed files
... ...
@@ -27,6 +27,9 @@ try: # python3
27 27
 	import configparser
28 28
 except ImportError: # python2
29 29
 	import ConfigParser as configparser
30
+	# overwrite default open() function
31
+	# this one supports encoding='...'
32
+	from codecs import open
30 33
 
31 34
 import os, glob, pprint, re, optparse, sys, gettext
32 35
 from xml.sax.saxutils import escape