Mailing List Archive

WinZip vs 0-length files (was RE: trivial import question)
With tne candidate release of Python 1.5.2 just out, this is quite timely!

At various times in March, at least Brad Clements, Lars Marius Garshol and
Tres Seaver spread the rumor that WinZip wouldn't extract 0-length files,
thus causing Python packages depending on an empty __init__.py to fail in
mysterious ways.

I tried reproducing that but had no problems with the latest WinZip, so had
a good time insulting them all <wink>.

But they were right! Steve Spicklemire provided the missing clue offline:
while WinZip does not have a problem with 0-length files in .zip archives,
it does indeed fail to extract them from .tgz archives.

Nico Mak (WinZip's source) confirmed this, adding that it's a problem for
all of .z, .gz, and .tgz archives (I think .tar belongs in there too), and
said it should be fixed in "a future release" (as opposed, I guess, to a
past release -- only Guido can pull that one off).

Since most Windows distributions get packaged as .zip archives, most times
you shouldn't have a problem. If you download the 1.5.2c1 *source*
distribution, though, note that there are three files in py152c1.tgz WinZip
fails to extract:

Python-1.5.2c1\Tools\pynche\__init__.py
Python-1.5.2c1\PC\vc15_lib\_.c
Python-1.5.2c1\PC\vc15_w31\_.c

be-careful-it's-an-empty-jungle-out-there-ly y'rs - tim
WinZip vs 0-length files (was RE: trivial import question) [ In reply to ]
would it work to make the __init__.py files just have a #comment in
them so that they wouldn't be 0 bytes? might save some confusion.
WinZip vs 0-length files (was RE: trivial import question) [ In reply to ]
[.Tim, passes on Nico Mak's confirmation that WinZip 7 does not extract
0-length files from .tgz/.gz/.z/.tar archives, but does from .zip
archives, and that the former behavior is an acknowledged bug
]

[Charles G Waldman]
> would it work to make the __init__.py files just have a #comment in
> them so that they wouldn't be 0 bytes?

Certainly should work, yes. Should also work to leave __init__.py empty but
also ship __init__.pyc files (which aren't empty even if __init__.py is).

words-to-the-wise-and-the-idle-ly y'rs - tim
WinZip vs 0-length files (was RE: trivial import question) [ In reply to ]
Tim Peters wrote:
>
> With tne candidate release of Python 1.5.2 just out, this is quite timely!
>
> At various times in March, at least Brad Clements, Lars Marius Garshol and
> Tres Seaver spread the rumor that WinZip wouldn't extract 0-length files,
> thus causing Python packages depending on an empty __init__.py to fail in
> mysterious ways.
>
> I tried reproducing that but had no problems with the latest WinZip, so had
> a good time insulting them all <wink>.
>
> But they were right! Steve Spicklemire provided the missing clue offline:
> while WinZip does not have a problem with 0-length files in .zip archives,
> it does indeed fail to extract them from .tgz archives.

Heh, vindication! I hadn't reproduced the problem myself since Tim's
chastisement (not the comfy chair!), and appreciate his graciousness in beating
us to the counterpunch.

--
=========================================================
Tres Seaver tseaver@palladion.com 713-523-6582
Palladion Software http://www.palladion.com