MCPcopy Index your code
hub / github.com/python/cpython / __init__

Method __init__

Lib/_android_support.py:37–54  ·  view source on GitHub ↗
(self, prio, tag, original=None, **kwargs)

Source from the content-addressed store, hash-verified

35
36class TextLogStream(io.TextIOWrapper):
37 def __init__(self, prio, tag, original=None, **kwargs):
38 # Respect the -u option.
39 if original:
40 kwargs.setdefault("write_through", original.write_through)
41 fileno = original.fileno()
42 else:
43 fileno = None
44
45 # The default is surrogateescape for stdout and backslashreplace for
46 # stderr, but in the context of an Android log, readability is more
47 # important than reversibility.
48 kwargs.setdefault("encoding", "UTF-8")
49 kwargs.setdefault("errors", "backslashreplace")
50
51 super().__init__(BinaryLogStream(prio, tag, fileno), **kwargs)
52 self._lock = RLock()
53 self._pending_bytes = []
54 self._pending_bytes_count = 0
55
56 def __repr__(self):
57 return f"<TextLogStream {self.buffer.tag!r}>"

Callers

nothing calls this directly

Calls 6

RLockFunction · 0.90
superClass · 0.85
BinaryLogStreamClass · 0.85
setdefaultMethod · 0.45
filenoMethod · 0.45
__init__Method · 0.45

Tested by

no test coverage detected