MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / __write

Method __write

tools/python-3.11.9-amd64/Lib/cgi.py:722–735  ·  view source on GitHub ↗

line is always bytes, not string

(self, line)

Source from the content-addressed store, hash-verified

720 self.read_lines_to_eof()
721
722 def __write(self, line):
723 """line is always bytes, not string"""
724 if self.__file is not None:
725 if self.__file.tell() + len(line) > 1000:
726 self.file = self.make_file()
727 data = self.__file.getvalue()
728 self.file.write(data)
729 self.__file = None
730 if self._binary_file:
731 # keep bytes
732 self.file.write(line)
733 else:
734 # decode to string
735 self.file.write(line.decode(self.encoding, self.errors))
736
737 def read_lines_to_eof(self):
738 """Internal: read lines until EOF."""

Callers 2

read_lines_to_eofMethod · 0.95

Calls 5

make_fileMethod · 0.95
tellMethod · 0.45
getvalueMethod · 0.45
writeMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected