REG/REF: close file handles engine-independently in read_csv
- [ ] closes #45384
- [ ] tests added / passed
- [ ] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them
- [ ] whatsnew entry

Open file handles in TextFileParser instead of in the read_csv engines. This makes it easier to close file handles in case of an  error.

It is probably better to merge #45388 (for 1.4.x) and then this PR for 1.5.
@twoertwein 

> It is probably better to merge #45388 (for 1.4.x) and then this PR for 1.5.

can we merge this to 1.4? i think its pretty comprehensive Yes, can go in 1.4.0 Just wasn't sure whether there will be enough time for this. thanks @twoertwein  @meeseeksdev backport 1.4.x Something went wrong ... Please have a look at my logs.