Marten H. van Kerkwijk <m...@astro.utoronto.ca> added the comment:
In astropy we are now working around the auto-closing of the underlying stream in TextIOWrapper by subclassing and overriding `__del__` to detach [1]. It would seem more elegant if `TestIOWrapper` (and really, `BufferedReader`) could gain an `closefd` argument, just like `open` has, which is `True` by default. p.s. Do let me know if it is better to open a new issue. [1] https://github.com/astropy/astropy/pull/11809 ---------- nosy: +mhvk type: -> enhancement _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue21363> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com