New submission from Vertu Joe <ultimal...@gmail.com>:

I intentionally made some corrupted zip archive files for testing.
If some contents were removed from the archive instead of changing the bits. 
when trying to read such files, the zipfile will raise an uncaught  OSError, 
instead of a badzipfile error as expected.

os is windows 10 x64 not sure if this also happens on the UNIX system or it's 
intended to be happen.

code:

import zipfile
with zipfile.ZipFile(r'damaged.zip') as dmg:
    dmg.testzip()

result:
OSError
[Errno 22] Invalid argument
  File "test.py", line 20, in <module>
    file = dmg.testzip()

----------
components: Library (Lib)
files: damaged.zip
messages: 414590
nosy: ultimalium
priority: normal
severity: normal
status: open
title: zipfile library will raise uncaught oserror when reading length 
incorrect zip file
type: behavior
versions: Python 3.10
Added file: https://bugs.python.org/file50658/damaged.zip

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue46931>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to