Close the file. A closed file cannot be used for further I/O operations. close() may be called more than once without error.
(self)
| 1761 | return size |
| 1762 | |
| 1763 | def close(self): |
| 1764 | """Close the file. |
| 1765 | |
| 1766 | A closed file cannot be used for further I/O operations. close() may be |
| 1767 | called more than once without error. |
| 1768 | """ |
| 1769 | if not self.closed: |
| 1770 | try: |
| 1771 | if self._closefd: |
| 1772 | os.close(self._fd) |
| 1773 | finally: |
| 1774 | super().close() |
| 1775 | |
| 1776 | def seekable(self): |
| 1777 | """True if file supports random-access.""" |