Kyle Altendorf <s...@fstab.net> added the comment:

Turns out the docs do document this.  My apologies.

https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT

   4.3.11  Archive extra data record: 

        archive extra data signature    4 bytes  (0x08064b50)
        extra field length              4 bytes
        extra field data                (variable size)

Aside from the discrepancy between 16-bits and 4 bytes, it seems like something 
should happen, even if it's something other than 'fixing' the code to handle 
the malformed data.  Isn't it a bug for zipfile to create a non-compliant file? 
 Shouldn't it either check or provide an interface by which a compliant file 
could sensibly be created?  It doesn't seem great to just expect users to 
rewrite this each time they call.

(42).to_bytes(4, 'little') + len(data).to_bytes(4, 'little') + data

or, should it be 'big'?  and would it be (len(data) + 4 + 4)?

----------

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

Reply via email to