def make_unistream(stream):
unistream = lambda: '<STR_LIT>'<EOL>for attr_name in dir(stream):<EOL><INDENT>if not attr_name.startswith('<STR_LIT:_>'):<EOL><INDENT>setattr(unistream, attr_name, getattr(stream, attr_name))<EOL><DEDENT><DEDENT>unistream.write = lambda b: stream.write(<EOL>unescape(to_bytes(b, unistream.encoding), unistream.encoding)<EOL>)<EOL>return unistream<EOL>
Make a stream which unescapes string literals before writes out.