aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/importlib
diff options
context:
space:
mode:
authorSamet YASLAN <sametyaslan@gmail.com>2022-12-28 22:31:43 +0100
committerGitHub <noreply@github.com>2022-12-28 16:31:43 -0500
commitf10f503b24a35a43910a632ee50c7568bedd6664 (patch)
treecf3119de337590c4682213430a70f12595541483 /Lib/importlib
parentcf1c09818032df3080c2cd9e7edb5f657213dc83 (diff)
downloadcpython-f10f503b24a35a43910a632ee50c7568bedd6664.tar.gz
cpython-f10f503b24a35a43910a632ee50c7568bedd6664.zip
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
Diffstat (limited to 'Lib/importlib')
-rw-r--r--Lib/importlib/resources/_common.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/importlib/resources/_common.py b/Lib/importlib/resources/_common.py
index 8c0be7ee547..92a37e2c12b 100644
--- a/Lib/importlib/resources/_common.py
+++ b/Lib/importlib/resources/_common.py
@@ -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