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

Incorrect reading "End of central directory record." (zipfile module) #108526

Open
Labels
stdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error
@igorechek06

Description

@igorechek06

Bug report

Checklist

  • I am confident this is a bug in CPython, not a bug in a third-party project
  • I have searched theCPython issue tracker,
    and am confident this bug has not been reported before

CPython versions tested on:

3.8, 3.9, 3.11

Operating systems tested on:

Linux

Output from running 'python -VV' on the command line:

No response

A clear and concise description of the bug:

This simple example fully describe this bug

fromzipfileimportZipFilewithZipFile("archive.zip","w")asarchive:archive.comment=b"PK\005\006"+b"\000"*18# Archive has a commentwitharchive.open("file1","w")asfile:# -\file.write(b"content")#                |#                                        |witharchive.open("file2","w")asfile:#  |file.write(b"content")#                |- 3 files#                                        |witharchive.open("file3","w")asfile:#  |file.write(b"content")#               -/withZipFile("archive.zip")asarchive:assertarchive.comment==b"PK\005\006"+b"\000"*18# Error - archie has no commentassertlen(archive.filelist)==3# Error - archive has no files

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp