self.specfile = os.path.basename(filename)
self.specdir = os.path.dirname(os.path.abspath(filename))
try:
- with open(filename) as spec_file:
+ with open(filename, errors='ignore') as spec_file:
for line in spec_file.readlines():
self._content.append(line)
except IOError as err:
def spec_from_repo(repo, treeish, spec_path):
"""Get and parse a spec file from a give Git treeish"""
try:
- spec = SpecFile(filedata=repo.show('%s:%s' % (treeish, spec_path)).decode())
+ spec = SpecFile(filedata=repo.show('%s:%s' % (treeish, spec_path)).decode(errors='ignore'))
spec.specdir = os.path.dirname(spec_path)
spec.specfile = os.path.basename(spec_path)
return spec