New GitHub issue #110287 from F-park:<br>
<hr>
<pre>
# Bug report
### Bug description:
### Bug description:
```python
import _pyio
def hook_del(__del__):
def wrapper(self):
__del__(self)
print("call __del__")
return wrapper
_pyio.IOBase.__del__ = hook_del(_pyio.IOBase.__del__)
strip_lines = (line.strip() for line in _pyio.StringIO("hello\nworld!"))
print(list(strip_lines))
```
```
call __del__
call __del__
['hello', 'world!']
```
### Affected functions:
- _pyio.StringIO
- _pyio.open
### CPython versions tested on:
3.8, 3.9, 3.10, 3.11, 3.12
### Operating systems tested on:
Windows
</pre>
<hr>
<a href="https://github.com/python/cpython/issues/110287">View on GitHub</a>
<p>Labels: type-bug</p>
<p>Assignee: </p>