Skip to content

Commit bd53e76

Browse files
committed
[testsuite] Drop characters that can't be decoded, restoring parity with Py2.
Tests that check the output of `memory find` may trip over unreadable characters, and in Python 3 this is an error. llvm-svn: 355612
1 parent 8a4efd2 commit bd53e76

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lldb/packages/Python/lldbsuite/support/encoded_file.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ def impl(s):
3131
# as unicode before attempting to write.
3232
if isinstance(s, six.binary_type):
3333
s = s.decode(encoding, "replace")
34+
# Filter unreadable characters, Python 3 is stricter than python 2 about them.
35+
import re
36+
s = re.sub(r'[^\x00-\x7f]',r' ',s)
3437
return old_write(s)
3538
return impl
3639

0 commit comments

Comments
 (0)