Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

GzipFile leaves GzipFile.myfileobject open in constructor if exception is raised #131492

Closed
Labels
stdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error
@graingert

Description

@graingert

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp