summaryrefslogtreecommitdiffstats
path: root/BuildManager/build.py
diff options
context:
space:
mode:
Diffstat (limited to 'BuildManager/build.py')
-rw-r--r--BuildManager/build.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/BuildManager/build.py b/BuildManager/build.py
index 4efe006..600d883 100644
--- a/BuildManager/build.py
+++ b/BuildManager/build.py
@@ -7,6 +7,7 @@ import sys, os
import time
import shutil
import glob
+import codecs
__all__ = ["PackageBuilder"]
@@ -203,7 +204,7 @@ def buildpkg(pkg, stage, unpack_dir, passtrough="", show_log=0, dryrun=0):
(stagechar,pkg.builddir,tmppath,passtrough,pkg.spec)
logger.debug("rpmbuild command: "+cmd)
if not dryrun:
- log = open(pkg.log, "w")
+ log = codecs.open(pkg.log, "w", 'utf-8', errors = "replace")
pop = subprocess.Popen(cmd, shell=True,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
of = pop.stdout.fileno()
@@ -211,7 +212,7 @@ def buildpkg(pkg, stage, unpack_dir, passtrough="", show_log=0, dryrun=0):
status = pop.poll()
if status is not None:
break
- data = os.read(of, 8192)
+ data = os.read(of, 8192).decode(sys.getfilesystemencoding())
log.write(data)
log.flush()
if show_log: