Skip to content

Commit

Permalink
gh-100585: Fixed a bug where importlib.resources.as_file was leaving …
Browse files Browse the repository at this point in the history
…file pointers open (GH-100586)

* gh-100585: Fixed open fp bug in the imporlib module

* Added news for gh-100585
  • Loading branch information
samety committed Dec 28, 2022
1 parent cf1c098 commit f10f503
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Lib/importlib/resources/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,5 +155,5 @@ def _write_contents(target, source):
for item in source.iterdir():
_write_contents(child, item)
else:
child.open('wb').write(source.read_bytes())
child.write_bytes(source.read_bytes())
return child
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed a bug where importlib.resources.as_file was leaving file pointers open

0 comments on commit f10f503

Please sign in to comment.