MCPcopy Index your code
hub / github.com/RustPython/RustPython / read_text

Method read_text

Lib/pathlib/__init__.py:780–788  ·  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

778 return f.read()
779
780 def read_text(self, encoding=None, errors=None, newline=None):
781 """
782 Open the file in text mode, read it, and close the file.
783 """
784 # Call io.text_encoding() here to ensure any warning is raised at an
785 # appropriate stack level.
786 encoding = io.text_encoding(encoding)
787 with self.open(mode='r', encoding=encoding, errors=errors, newline=newline) as f:
788 return f.read()
789
790 def write_bytes(self, data):
791 """

Callers 15

expect_fileMethod · 0.95
check_contextMethod · 0.45
test_reprMethod · 0.45
test_missing_metadataMethod · 0.45
test_for_top_levelMethod · 0.45
test_read_textMethod · 0.45
_test_filesMethod · 0.45
test_read_textMethod · 0.45
test_module_resourcesMethod · 0.45
test_spec_path_openMethod · 0.45
test_child_path_openMethod · 0.45

Calls 2

openMethod · 0.95
readMethod · 0.45

Tested by 15

expect_fileMethod · 0.76
check_contextMethod · 0.36
test_reprMethod · 0.36
test_missing_metadataMethod · 0.36
test_for_top_levelMethod · 0.36
test_read_textMethod · 0.36
_test_filesMethod · 0.36
test_read_textMethod · 0.36
test_module_resourcesMethod · 0.36
test_spec_path_openMethod · 0.36
test_child_path_openMethod · 0.36