>>> from io import StringIO >>> for line in StringIO("foo\x85bar\vquux\u2028zoot"): print(repr(line)) ... 'foo\x85bar\x0bquux\u2028zoot'