Fix exception raise at rpdb session
Some components raise unrelated exceptions during rpdb session due to unaware attribute handling of file-like objects Change-Id: I04dd5a7d0f6ec2920671dfa612439427dffefd52 Closes-bug: #1791104
This commit is contained in:
parent
5b7c99bbc5
commit
6e0b90be22
@ -42,7 +42,7 @@ def safe_decode(text, incoming=None, errors='strict'):
|
||||
return text
|
||||
|
||||
if not incoming:
|
||||
incoming = (sys.stdin.encoding or
|
||||
incoming = (getattr(sys.stdin, 'encoding', None) or
|
||||
sys.getdefaultencoding())
|
||||
|
||||
try:
|
||||
@ -85,7 +85,7 @@ def safe_encode(text, incoming=None,
|
||||
raise TypeError("%s can't be encoded" % type(text))
|
||||
|
||||
if not incoming:
|
||||
incoming = (sys.stdin.encoding or
|
||||
incoming = (getattr(sys.stdin, 'encoding', None) or
|
||||
sys.getdefaultencoding())
|
||||
|
||||
# Avoid case issues in comparisons
|
||||
|
Loading…
Reference in New Issue
Block a user