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

Method read_text

Lib/pathlib/__init__.py:978–986  ·  view source on GitHub ↗

Open the file in text mode, read it, and close the file.

(self, encoding=None, errors=None, newline=None)

Source from the content-addressed store, hash-verified

976 return f.read()
977
978 def read_text(self, encoding=None, errors=None, newline=None):
979 """
980 Open the file in text mode, read it, and close the file.
981 """
982 # Call io.text_encoding() here to ensure any warning is raised at an
983 # appropriate stack level.
984 encoding = io.text_encoding(encoding)
985 with self.open(mode='r', encoding=encoding, errors=errors, newline=newline) as f:
986 return f.read()
987
988 def write_bytes(self, data):
989 """

Callers 15

test_pre_fork_compileMethod · 0.95
test_trampoline_worksMethod · 0.95
test_sys_apiMethod · 0.95
test_pre_fork_compileMethod · 0.95
expect_fileMethod · 0.95
mainFunction · 0.45
mainFunction · 0.45
inject_traceFunction · 0.45
runMethod · 0.45
get_header_version_infoFunction · 0.45
read_refcount_dataFunction · 0.45

Calls 2

openMethod · 0.95
readMethod · 0.45

Tested by 15

test_pre_fork_compileMethod · 0.76
test_trampoline_worksMethod · 0.76
test_sys_apiMethod · 0.76
test_pre_fork_compileMethod · 0.76
expect_fileMethod · 0.76
check_contextMethod · 0.36
test_reprMethod · 0.36
test_read_textMethod · 0.36
test_module_resourcesMethod · 0.36
test_spec_path_openMethod · 0.36