Skip to content

use context to close file nicely#1147

Merged
hackebrot merged 1 commit intocookiecutter:masterfrom
jcb91:feature/close_filehandle
Aug 27, 2019
Merged

use context to close file nicely#1147
hackebrot merged 1 commit intocookiecutter:masterfrom
jcb91:feature/close_filehandle

Conversation

@jcb91
Copy link
Copy Markdown

@jcb91 jcb91 commented Feb 8, 2019

When running cookiecutter from other python scripts, I get warnings about unclosed filehandles. This PR uses the io.open contextmanager to close the handle once the read is complete.

@jcb91 jcb91 force-pushed the feature/close_filehandle branch from 8366d80 to 97c6d3a Compare February 8, 2019 13:47
@codecov-io
Copy link
Copy Markdown

codecov-io commented Feb 8, 2019

Codecov Report

Merging #1147 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #1147   +/-   ##
======================================
  Coverage     100%    100%           
======================================
  Files          18      18           
  Lines         783     784    +1     
======================================
+ Hits          783     784    +1
Impacted Files Coverage Δ
cookiecutter/hooks.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3bc7b98...97c6d3a. Read the comment docs.

@luzfcb
Copy link
Copy Markdown
Contributor

luzfcb commented Feb 8, 2019

LGTM

@ssbarnea ssbarnea closed this Jul 13, 2019
@ssbarnea ssbarnea reopened this Jul 13, 2019
Copy link
Copy Markdown
Member

@hackebrot hackebrot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🚀

@hackebrot
Copy link
Copy Markdown
Member

Thank you for your contribution @jcb91! 🍪

@hackebrot hackebrot merged commit ca3cb7d into cookiecutter:master Aug 27, 2019
hackebrot added a commit that referenced this pull request Aug 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants