MCPcopy Index your code
hub / github.com/cherrypy/cherrypy / UTF8StreamEncoder

Class UTF8StreamEncoder

cherrypy/lib/encoding.py:43–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41
42
43class UTF8StreamEncoder:
44 def __init__(self, iterator):
45 self._iterator = iterator
46
47 def __iter__(self):
48 return self
49
50 def next(self):
51 return self.__next__()
52
53 def __next__(self):
54 res = next(self._iterator)
55 if isinstance(res, str):
56 res = res.encode('utf-8')
57 return res
58
59 def close(self):
60 if is_closable_iterator(self._iterator):
61 self._iterator.close()
62
63 def __getattr__(self, attr):
64 if attr.startswith('__'):
65 raise AttributeError(self, attr)
66 return getattr(self._iterator, attr)
67
68
69class ResponseEncoder:

Callers 1

get_error_pageFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…