Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REG/REF: close file handles engine-independently in read_csv #45389

Merged
merged 2 commits into from Jan 16, 2022

Conversation

twoertwein
Copy link
Member

@twoertwein twoertwein commented Jan 15, 2022

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 twoertwein added the IO CSV read_csv, to_csv label Jan 15, 2022
@jreback
Copy link
Contributor

jreback commented Jan 16, 2022

@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

@jreback jreback added this to the 1.4 milestone Jan 16, 2022
@twoertwein
Copy link
Member Author

Yes, can go in 1.4.0 Just wasn't sure whether there will be enough time for this.

@jreback jreback merged commit 6cc5584 into pandas-dev:main Jan 16, 2022
@jreback
Copy link
Contributor

jreback commented Jan 16, 2022

thanks @twoertwein

@jreback
Copy link
Contributor

jreback commented Jan 16, 2022

@meeseeksdev backport 1.4.x

@lumberbot-app
Copy link

lumberbot-app bot commented Jan 16, 2022

Something went wrong ... Please have a look at my logs.

jreback pushed a commit that referenced this pull request Jan 17, 2022
…in read_csv (#45398)

Co-authored-by: Torsten Wörtwein <twoertwein@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO CSV read_csv, to_csv
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: read_csv can leak file handles if validation fails
2 participants