Skip to content

Conversation

twoertwein
Copy link
Member

  • passes black pandas
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff

Follow up to #37639. Close file handles as early as possible.

Remove close calls that are already within a try-except/finally block that closes the file handles.

Add close call for read_json when we read the entire content in one go.

Add close call in read_csv when reaching the end of the iterator.

Put to/read_excel in a try-finally block to make sure that file handles are closed even in case of an exception.

@jreback jreback added the IO Data IO issues that don't fit into a more specific label label Nov 14, 2020
@jreback jreback added this to the 1.2 milestone Nov 14, 2020
@jreback
Copy link
Contributor

jreback commented Nov 14, 2020

small comment, ping on green.

@jreback jreback merged commit 342640b into pandas-dev:master Nov 15, 2020
@jreback
Copy link
Contributor

jreback commented Nov 15, 2020

thanks @twoertwein

@twoertwein twoertwein deleted the close branch November 15, 2020 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO Data IO issues that don't fit into a more specific label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants