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

Method read_file

Lib/configparser.py:762–775  ·  view source on GitHub ↗

Like read() but the argument must be a file-like object. The `f` argument must be iterable, returning one line at a time. Optional second argument is the `source` specifying the name of the file being read. If not given, it is taken from f.name. If `f` has no `name`

(self, f, source=None)

Source from the content-addressed store, hash-verified

760 return read_ok
761
762 def read_file(self, f, source=None):
763 """Like read() but the argument must be a file-like object.
764
765 The `f` argument must be iterable, returning one line at a time.
766 Optional second argument is the `source` specifying the name of the
767 file being read. If not given, it is taken from f.name. If `f` has no
768 `name` attribute, `<???>` is used.
769 """
770 if source is None:
771 try:
772 source = f.name
773 except AttributeError:
774 source = '<???>'
775 self._read(f, source)
776
777 def read_string(self, string, source='<string>'):
778 """Read configuration from a given string."""

Callers 1

read_stringMethod · 0.95

Calls 1

_readMethod · 0.95

Tested by

no test coverage detected