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>
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)