Open the file in text mode, read it, and close the file.
(self, encoding=None, errors=None, newline=None)
| 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 | """ |