Close the file. A closed file cannot be used for further I/O operations. close() may be called more than once without error.
(self)
| 1781 | return size |
| 1782 | |
| 1783 | def close(self): |
| 1784 | """Close the file. |
| 1785 | |
| 1786 | A closed file cannot be used for further I/O operations. close() may be |
| 1787 | called more than once without error. |
| 1788 | """ |
| 1789 | if not self.closed: |
| 1790 | self._stat_atopen = None |
| 1791 | try: |
| 1792 | if self._closefd and self._fd >= 0: |
| 1793 | os.close(self._fd) |
| 1794 | finally: |
| 1795 | super().close() |
| 1796 | |
| 1797 | def seekable(self): |
| 1798 | """True if file supports random-access.""" |