Issue #6697: Fix a crash if sys.stdin or sys.stdout encoding contain a surrogate

This is *very* unlikely :-)
1 file changed