Skip to content

Calling ZipFile.mkdir() on a new ZipInfo object gets an attribute error #154174

Description

@danny0838

Bug report

Bug description:

with zipfile.ZipFile(io.BytesIO(), 'w') as zh:
    zinfo = zipfile.ZipInfo('mydir/')
    zh.mkdir(zinfo)

The above code raises AttributeError: 'zipfile.ZipInfo' object has no attribute 'CRC'.

CPython versions tested on:

3.14

Operating systems tested on:

No response

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions