Skip to content

gh-158494: zipimport: raise ZipImportError for corrupt deflate data - #158498

Open
Tony123-tech wants to merge 1 commit into
python:mainfrom
Tony123-tech:gh-158494-zipimport-corrupt-deflate
Open

Tony123-tech wants to merge 1 commit into
python:mainfrom
Tony123-tech:gh-158494-zipimport-corrupt-deflate

Conversation

@Tony123-tech

@Tony123-tech Tony123-tech commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Comment thread Lib/test/test_zipimport.py Outdated
TESTMOD + pyc_ext: badtime_pyc}
self.doTest(".py", files, TESTMOD)

def testCorruptDeflateDataRaisesZipImportError(self):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is a bit verbose. I think we can just add it to the existing DeflateCompressedZipImportTestCase, and reuse the helpers there like makeZip() to reduce lots of codes.

@Tony123-tech
Tony123-tech force-pushed the gh-158494-zipimport-corrupt-deflate branch from 4add466 to 77e0eb2 Compare October 1, 2026 11:12
Comment thread Lib/test/test_zipimport.py Outdated
Comment thread Lib/test/test_zipimport.py
Comment thread Lib/test/test_zipimport.py Outdated
@Tony123-tech
Tony123-tech force-pushed the gh-158494-zipimport-corrupt-deflate branch from e0b3a3c to d88bc39 Compare October 2, 2026 09:29
@Tony123-tech

Copy link
Copy Markdown
Contributor Author

All three suggestions applied and squashed to a single commit. Let me know if there's anything else.

@aisk

aisk commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

Hi @Tony123-tech , according to the Dev Guide, force push should be avoided, so please don't force push in the future.

We will use "squash and merge" to merge a PR, so we don't need to squash it before merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants