Open the file in text mode, write to it, and close the file.
(self, data, encoding=None, errors=None, newline=None)
| 1068 | return f.write(view) |
| 1069 | |
| 1070 | def write_text(self, data, encoding=None, errors=None, newline=None): |
| 1071 | """ |
| 1072 | Open the file in text mode, write to it, and close the file. |
| 1073 | """ |
| 1074 | if not isinstance(data, str): |
| 1075 | raise TypeError('data must be str, not %s' % |
| 1076 | data.__class__.__name__) |
| 1077 | encoding = io.text_encoding(encoding) |
| 1078 | with self.open(mode='w', encoding=encoding, errors=errors, newline=newline) as f: |
| 1079 | return f.write(data) |
| 1080 | |
| 1081 | def readlink(self): |
| 1082 | """ |
no test coverage detected