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
Bug description:
consider the following program, it should raise an ExceptionGroup(..., [ValueError(), ValueError(), ...] but actually it raises OSError: [Errno 24] Too many open files: '/tmp/tmpk8gaprry'
importgzipimporttempfileimportpathlibimportosdefmain():withtempfile.TemporaryDirectory()astmp_dir:tmp_path=pathlib.Path(tmp_dir)zip_path=tmp_path/"some_file.zip"exceptions= []foriinrange(2000):try:gzip.GzipFile(filename=os.fsdecode(zip_path),mode="w",compresslevel=99)exceptValueErrorase:exceptions.append(e)ifexceptions:raiseExceptionGroup("multiple errors creating GzipFiles",exceptions)main()
CPython versions tested on:
CPython main branch, 3.14, 3.13, 3.12, 3.11
Operating systems tested on:
Linux
Linked PRs
- gh-131492: gh-131461: handle exceptions in GzipFile constructor while owning resources #131462
- [3.13] gh-131492, gh-131461: handle exceptions in GzipFile constructor while owning resources (GH-131462) #131518
- [3.12] gh-131492, gh-131461: handle exceptions in GzipFile constructor while owning resources (GH-131462) #131519