(self, content, *, mode='w')
| 40 | # Write a content (str or bytes) to temp file, and return the |
| 41 | # temp file's name. |
| 42 | def writeTmp(self, content, *, mode='w'): # opening in text mode is the default |
| 43 | fd, name = tempfile.mkstemp() |
| 44 | self.addCleanup(os_helper.unlink, name) |
| 45 | encoding = None if "b" in mode else "utf-8" |
| 46 | with open(fd, mode, encoding=encoding) as f: |
| 47 | f.write(content) |
| 48 | return name |
| 49 | |
| 50 | class LineReader: |
| 51 |
no test coverage detected