Open the file in bytes mode, write to it, and close the file.
(self, data)
| 1059 | return f.read() |
| 1060 | |
| 1061 | def write_bytes(self, data): |
| 1062 | """ |
| 1063 | Open the file in bytes mode, write to it, and close the file. |
| 1064 | """ |
| 1065 | # type-check for the buffer interface before truncating the file |
| 1066 | view = memoryview(data) |
| 1067 | with self.open(mode='wb') as f: |
| 1068 | return f.write(view) |
| 1069 | |
| 1070 | def write_text(self, data, encoding=None, errors=None, newline=None): |
| 1071 | """ |
no test coverage detected