summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2019-01-03 13:16:13 (GMT)
committerTobias Markmann <tm@ayena.de>2019-01-07 19:56:36 (GMT)
commit6874d64ed2684d83cb3e340f58f6c8c5089aa857 (patch)
tree24fa6af35302b2d7429f464a37fed9c378ee6f99 /BuildTools/SCons/Tools/textfile.py
parent1632f62222bb10516b2f85249083c0fb30c7d1b3 (diff)
downloadswift-6874d64ed2684d83cb3e340f58f6c8c5089aa857.zip
swift-6874d64ed2684d83cb3e340f58f6c8c5089aa857.tar.bz2
Update for Debianswift-4.0.3
Fix UTF-8 handling issues in BuildTools/SCons/Tools/textfile.py . Test-Information: Tested that ./scons test=unit Swift works on Debain Unstable (sid) and macOS 10.14.2. Tested that build_for_debian.sh runs successfully on latest Debian Unstable (sid). Change-Id: I29d8c97ce3b4eb3e4fd680bdc814fb0c911262ff
Diffstat (limited to 'BuildTools/SCons/Tools/textfile.py')
-rw-r--r--BuildTools/SCons/Tools/textfile.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/BuildTools/SCons/Tools/textfile.py b/BuildTools/SCons/Tools/textfile.py
index 89f8963..cc58666 100644
--- a/BuildTools/SCons/Tools/textfile.py
+++ b/BuildTools/SCons/Tools/textfile.py
@@ -63,7 +63,7 @@ def _do_subst(node, subs):
63 then all instances of %VERSION% in the file will be replaced with 63 then all instances of %VERSION% in the file will be replaced with
64 1.2345 and so forth. 64 1.2345 and so forth.
65 """ 65 """
66 contents = node.get_text_contents() 66 contents = node.get_contents().decode('utf-8')
67 if not subs: return contents 67 if not subs: return contents
68 for (k,v) in subs: 68 for (k,v) in subs:
69 contents = re.sub(k, v, contents) 69 contents = re.sub(k, v, contents)
@@ -113,7 +113,7 @@ def _action(target, source, env):
113 lsep = None 113 lsep = None
114 for s in source: 114 for s in source:
115 if lsep: fd.write(lsep) 115 if lsep: fd.write(lsep)
116 fd.write(_do_subst(s, subs)) 116 fd.write(_do_subst(s, subs).encode("utf-8"))
117 lsep = linesep 117 lsep = linesep
118 fd.close() 118 fd.close()
119 119