From ce63cd3e186239748bf0b3c1ae25c477045c488c Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Wed, 29 May 2019 12:19:47 +0200 Subject: [PATCH] Properly parse error message in metafile.edit --- osc/core.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/osc/core.py b/osc/core.py index bceb76a1..16e2b7c2 100644 --- a/osc/core.py +++ b/osc/core.py @@ -3697,9 +3697,10 @@ class metafile: print('BuildService API error:', error_help, file=sys.stderr) # examine the error - we can't raise an exception because we might want # to try again - data = e.read() - if b'' in data: - print(data.split(b'')[1].split(b'')[0], file=sys.stderr) + root = ET.fromstring(e.read()) + summary = root.find('summary') + if summary is not None: + print(summary.text, file=sys.stderr) ri = raw_input('Try again? ([y/N]): ') if ri not in ['y', 'Y']: break