PR#2598: lib: better print with debug_xmlrpc
Merges #2598 https://pagure.io/koji/pull-request/2598 Fixes: #2597 https://pagure.io/koji/issue/2597 lib: print decoded bytes with debug_xmlrpc
This commit is contained in:
commit
6a4f96179b
1 changed files with 5 additions and 2 deletions
|
|
@ -2702,8 +2702,11 @@ class ClientSession(object):
|
|||
_val = callopts[_key]
|
||||
if _key == 'data':
|
||||
if six.PY3 and isinstance(_val, bytes):
|
||||
# convert to hex-string
|
||||
_val = '0x' + _val.hex()
|
||||
try:
|
||||
_val = _val.decode()
|
||||
except UnicodeDecodeError:
|
||||
# convert to hex-string
|
||||
_val = '0x' + _val.hex()
|
||||
if len(_val) > 1024:
|
||||
_val = _val[:1024] + '...'
|
||||
self.logger.debug("%s: %r" % (_key, _val))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue