mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-26 14:46:14 +01:00
[python3] msg and body are byte strings
This commit is contained in:
parent
7bd9ca485d
commit
4269426b28
@ -16,6 +16,7 @@ from osc import oscerr
|
||||
from .oscsslexcp import NoSecureSSLError
|
||||
from osc.util.cpio import CpioError
|
||||
from osc.util.packagequery import PackageError
|
||||
from osc.util.helper import decode_it
|
||||
|
||||
try:
|
||||
from M2Crypto.SSL.Checker import SSLVerificationError
|
||||
@ -112,11 +113,11 @@ def run(prg, argv=None):
|
||||
print(body, file=sys.stderr)
|
||||
|
||||
if e.code in [400, 403, 404, 500]:
|
||||
if '<summary>' in body:
|
||||
msg = body.split('<summary>')[1]
|
||||
msg = msg.split('</summary>')[0]
|
||||
msg = msg.replace('<', '<').replace('>' , '>').replace('&', '&')
|
||||
print(msg, file=sys.stderr)
|
||||
if b'<summary>' in body:
|
||||
msg = body.split(b'<summary>')[1]
|
||||
msg = msg.split(b'</summary>')[0]
|
||||
msg = msg.replace(b'<', b'<').replace(b'>' , b'>').replace(b'&', b'&')
|
||||
print(decode_it(msg), file=sys.stderr)
|
||||
if e.code >= 500 and e.code <= 599:
|
||||
print('\nRequest: %s' % e.filename)
|
||||
print('Headers:')
|
||||
|
Loading…
Reference in New Issue
Block a user