Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Bug report
importlib.resources.as_file is leaving temporary file pointers open after writing their contents
see_write_contents function in importlib/resources/_common.py
Easy to repeat, just run the test case below with-WeLib.test.test_importlib.resources.test_resource.ResourceFromZipsTest01.test_as_file_directory
Your environment
- CPython versions tested on: Python 3.12.0a3+
- Operating system and architecture: Ubuntu 22.04.1 LTS
I think it just needs to usePath.write_bytes and keep the file pointer closed.