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

Method readline

Lib/http/client.py:706–721  ·  view source on GitHub ↗
(self, limit=-1)

Source from the content-addressed store, hash-verified

704 return self.fp.peek(n)
705
706 def readline(self, limit=-1):
707 if self.fp is None or self._method == "HEAD":
708 return b""
709 if self.chunked:
710 # Fallback to IOBase readline which uses peek() and read()
711 return super().readline(limit)
712 if self.length is not None and (limit < 0 or limit > self.length):
713 limit = self.length
714 result = self.fp.readline(limit)
715 if not result and limit:
716 self._close_conn()
717 elif self.length is not None:
718 self.length -= len(result)
719 if not self.length:
720 self._close_conn()
721 return result
722
723 def _read1_chunked(self, n):
724 # Strictly speaking, _get_chunk_left() may cause more than one read,

Callers 9

test_mixed_readsMethod · 0.95
_read_headersFunction · 0.45
_read_statusMethod · 0.45
_read_next_chunk_sizeMethod · 0.45
_really_loadMethod · 0.45
_really_loadMethod · 0.45
handle_one_requestMethod · 0.45

Calls 2

_close_connMethod · 0.95
superClass · 0.85

Tested by 2

test_mixed_readsMethod · 0.76