gh-100585: Fixed a bug where importlib.resources.as_file was leaving file pointers open (GH-100586)

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

* Added news for gh-100585
This commit is contained in:
Samet YASLAN 2022-12-28 22:31:43 +01:00 committed by GitHub
parent cf1c098180
commit f10f503b24
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View file

@ -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

View file

@ -0,0 +1 @@
Fixed a bug where importlib.resources.as_file was leaving file pointers open