summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlav Vitters <olav@vitters.nl>2020-05-11 10:36:34 +0200
committerOlav Vitters <olav@vitters.nl>2020-05-11 10:36:34 +0200
commit30d421400539ebef835aa5956c7aa9068d9e0601 (patch)
tree43649365933207531ca3620f3cfa12b9af2285ca
parent70908038e1729c264ff92c5ce3892f93a28f0bbe (diff)
downloadmgagnome-30d421400539ebef835aa5956c7aa9068d9e0601.tar
mgagnome-30d421400539ebef835aa5956c7aa9068d9e0601.tar.gz
mgagnome-30d421400539ebef835aa5956c7aa9068d9e0601.tar.bz2
mgagnome-30d421400539ebef835aa5956c7aa9068d9e0601.tar.xz
mgagnome-30d421400539ebef835aa5956c7aa9068d9e0601.zip
assume output is utf-8 (as per some Python verison)
-rwxr-xr-xmgagnome14
1 files changed, 7 insertions, 7 deletions
diff --git a/mgagnome b/mgagnome
index 8c80bd5..321916a 100755
--- a/mgagnome
+++ b/mgagnome
@@ -395,9 +395,9 @@ class SpecFile():
def _sources_and_patches(self, flag=None):
os.chdir(self.cwd)
rpm.delMacro("_topdir")
- rpm.addMacro("_topdir", self.cwd)
+ rpm.addMacro("_topdir", str(self.cwd))
trans_set = rpm.ts()
- spec = trans_set.parseSpec(self.path)
+ spec = trans_set.parseSpec(str(self.path))
try:
srclist = spec.sources if isinstance(spec.sources, (list, tuple)) \
else spec.sources()
@@ -951,10 +951,10 @@ class SpecFile():
Parses the spec file to do this, so any macros are expanded"""
rpm.delMacro("_topdir")
- rpm.addMacro("_topdir", self.cwd)
+ rpm.addMacro("_topdir", str(self.cwd))
trans_set = rpm.ts()
try:
- spec = trans_set.parseSpec(self.path)
+ spec = trans_set.parseSpec(str(self.path))
except ValueError as exc:
# Reraise this into a more specific exception
raise SpecFileError from exc
@@ -2211,7 +2211,7 @@ def cmd_parse_ftp_release_list(options):
if error:
# XXX - ugly
contents.seek(0)
- lastline = contents.read().decode('utf-8').rstrip().splitlines()[-1]
+ lastline = contents.read().rstrip().splitlines()[-1]
# Remove things like "ERROR: " and so on from the last line
lastline = re.sub(r'^(?:[^ :]+:\s+)+', '', lastline)
# Remove things like " - " (youri output from mgarepo submit)
@@ -2243,7 +2243,7 @@ def cmd_parse_ftp_release_list(options):
msg = email.message_from_file(sys.stdin)
if options.mail:
- stdout = tempfile.TemporaryFile()
+ stdout = tempfile.TemporaryFile(mode='w+t', encoding='utf-8')
stderr = stdout
else:
stdout = sys.stdout
@@ -2264,7 +2264,7 @@ def cmd_parse_ftp_release_list(options):
packages = Downstream().get_downstream_from_upstream(module, version)
except (ValueError, SpecFileError) as exc:
#print(bytes("ERROR: %s" % str(exc), 'UTF-8'), file=stderr)
- stderr.write(bytes("ERROR: %s" % str(exc), 'UTF-8'))
+ stderr.write("ERROR: %s" % str(exc))
if options.mail:
_send_reply_mail(stdout, msg, options.mail, error=True)