Closed
Description
In several docstrings we write some data to a temporary file to illustrate reading / writing functionality.
However, this leaves behind those files when running the docstest, which is not ideal.
@TomAugspurger from #20208 (review)
We can
- convert this to a regular code-block
- Use
io.StringIO
, which is uglier but doesn't leave behind a file- Add a bit to
os.remove('test.csv')