mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
selftest/filter: PY3 Make filter-subunit forgiving of decoding errors
samba4.local.ndr for one is a test that outputs string in an encoding that stdin.readline() guesses to be utf8 (but it isn't) filter subunit can afford to be forgiving of some random text that can't be decoded as utf8 so lets do that. Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
b142e28e35
commit
55f51476ac
@ -102,7 +102,13 @@ else:
|
||||
flapping=flapping)
|
||||
|
||||
try:
|
||||
ret = subunithelper.parse_results(msg_ops, statistics, sys.stdin)
|
||||
from samba.compat import PY3
|
||||
from io import TextIOWrapper as TextIOWrapper
|
||||
if PY3:
|
||||
forgiving_stdin = TextIOWrapper(sys.stdin.buffer, errors='ignore', encoding='utf-8')
|
||||
else:
|
||||
forgiving_stdin = sys.stdin
|
||||
ret = subunithelper.parse_results(msg_ops, statistics, forgiving_stdin)
|
||||
except subunithelper.ImmediateFail:
|
||||
sys.stdout.flush()
|
||||
sys.exit(1)
|
||||
|
Loading…
Reference in New Issue
Block a user