summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPapoteur <papoteur@mageialinux-online.org>2015-09-27 22:33:56 +0200
committerPapoteur <papoteur@mageialinux-online.org>2015-09-27 22:33:56 +0200
commiteb24f07f7c3292b23e87029b24ff2871ab6ee94a (patch)
tree154ea9156f2d210df1fb2169134b021a36231bf2
parent0e5ba1b12e16f499bd06e793681f62eb9de45c27 (diff)
downloadbm-eb24f07f7c3292b23e87029b24ff2871ab6ee94a.tar
bm-eb24f07f7c3292b23e87029b24ff2871ab6ee94a.tar.gz
bm-eb24f07f7c3292b23e87029b24ff2871ab6ee94a.tar.bz2
bm-eb24f07f7c3292b23e87029b24ff2871ab6ee94a.tar.xz
bm-eb24f07f7c3292b23e87029b24ff2871ab6ee94a.zip
Correction for opening spec file including special characters
-rw-r--r--BuildManager/package.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/BuildManager/package.py b/BuildManager/package.py
index b9646a5..031e36e 100644
--- a/BuildManager/package.py
+++ b/BuildManager/package.py
@@ -4,6 +4,7 @@ from collections import UserList
import subprocess
import os
import re
+import codecs
class BuildManagerFileError(Error): pass
class BuildManagerPackageError(Error): pass
@@ -98,7 +99,7 @@ class _package_spec(_package):
self.builddir = os.path.dirname(os.path.dirname(self.absfile))
ret = os.system("mkdir -p %s/{SOURCES,SPECS,BUILD,SRPMS,RPMS,BUILDROOT}" % self.builddir)
try:
- f = open(self.spec,"r")
+ f = codecs.open(self.spec, "r", 'utf-8', errors = "replace")
except IOError as e:
raise BuildManagerFileError("couldn't open spec file %s" % self.absfile)
defines = {}