From eb24f07f7c3292b23e87029b24ff2871ab6ee94a Mon Sep 17 00:00:00 2001 From: Papoteur Date: Sun, 27 Sep 2015 22:33:56 +0200 Subject: Correction for opening spec file including special characters --- BuildManager/package.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 = {} -- cgit v1.2.1