Close the file. A closed file cannot be used for further I/O operations. close() may be called more than once without error.
(self)
| 1802 | return size |
| 1803 | |
| 1804 | def close(self): |
| 1805 | """Close the file. |
| 1806 | |
| 1807 | A closed file cannot be used for further I/O operations. close() may be |
| 1808 | called more than once without error. |
| 1809 | """ |
| 1810 | if not self.closed: |
| 1811 | self._stat_atopen = None |
| 1812 | try: |
| 1813 | if self._closefd and self._fd >= 0: |
| 1814 | os.close(self._fd) |
| 1815 | finally: |
| 1816 | super().close() |
| 1817 | |
| 1818 | def seekable(self): |
| 1819 | """True if file supports random-access.""" |