From: Uwe Stöhr Date: Mon, 16 Oct 2017 21:29:57 +0000 (+0200) Subject: ReplaceValues.py: make the file compilable with Python 3 X-Git-Tag: lyx-2.4.0dev-acb2ca7b~4465 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=f075f8ad0a7a6fe3afe99eb11bc60cd85cb24585;p=lyx.git ReplaceValues.py: make the file compilable with Python 3 see the mailing list thread "compilation of LyX 2.3 fails with Python 3.6.2" for details --- diff --git a/development/cmake/doc/ReplaceValues.py b/development/cmake/doc/ReplaceValues.py index f07ce80bc9..41ed6e212c 100755 --- a/development/cmake/doc/ReplaceValues.py +++ b/development/cmake/doc/ReplaceValues.py @@ -13,6 +13,7 @@ from __future__ import print_function import sys import re +import codecs Subst = {} # map of desired substitutions prog = re.compile("") @@ -33,8 +34,8 @@ def SubstituteDataInLine(line): def SubstituteDataInFile(InFile): - for line in open(InFile): - print(SubstituteDataInLine(line[:-1])) + for line in codecs.open(InFile, 'r', 'utf-8'): + print(SubstituteDataInLine(line[:-1]).encode("utf-8")) ##########################################