diff options
author | Alex Goodman <wagoodman@users.noreply.github.com> | 2018-04-22 08:34:30 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-22 08:34:30 -0400 |
commit | 53503591adffb77a1b61206cac2de08c0cce43d8 (patch) | |
tree | 2bbb9efa044a6c976e621b739c56605d0236cdc1 | |
parent | b151d377b2988f985a24c8e260df5a48779339ab (diff) | |
parent | fd0a834f5ae8cb2b8a456a8d8a7042266ea8645d (diff) | |
download | wsdiff-53503591adffb77a1b61206cac2de08c0cce43d8.tar.gz wsdiff-53503591adffb77a1b61206cac2de08c0cce43d8.tar.bz2 wsdiff-53503591adffb77a1b61206cac2de08c0cce43d8.zip |
Merge pull request #8 from nnako/master
FIX: fix Python v2 issues with special characters (e.g. in German)
-rw-r--r-- | diff2HtmlCompare.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/diff2HtmlCompare.py b/diff2HtmlCompare.py index 04b1f3c..644ce93 100644 --- a/diff2HtmlCompare.py +++ b/diff2HtmlCompare.py @@ -292,7 +292,7 @@ class CodeDiff(object): self.fromfile = fromfile if fromtxt == None: try: - with open(fromfile) as f: + with io.open(fromfile) as f: self.fromlines = f.readlines() except Exception as e: print("Problem reading file %s" % fromfile) @@ -305,7 +305,7 @@ class CodeDiff(object): self.tofile = tofile if totxt == None: try: - with open(tofile) as f: + with io.open(tofile) as f: self.tolines = f.readlines() except Exception as e: print("Problem reading file %s" % tofile) @@ -389,7 +389,7 @@ class CodeDiff(object): self.htmlContents = HTML_TEMPLATE % answers def write(self, path): - fh = open(path, 'w') + fh = io.open(path, 'w') fh.write(self.htmlContents) fh.close() |