<div class="gmail_quote">On Tue, May 28, 2013 at 2:50 AM, Damian Johnson <span dir="ltr"><<a href="mailto:atagar@torproject.org" target="_blank">atagar@torproject.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


So far, so good. By my read of the man pages this means that gzip or<br>
python's zlib module should be able to handle the decompression.<br>
However, I must be missing something...<br>
<br>
% wget <a href="http://128.31.0.34:9131/tor/server/all.z" target="_blank">http://128.31.0.34:9131/tor/server/all.z</a><br>
<br>
[...]<br>
<br>
% python<br>
>>> import zlib<br>
>>> with open('all.z') as desc_file:<br>
...   print zlib.decompress(desc_file.read())<br>
...<br>
Traceback (most recent call last):<br>
  File "<stdin>", line 2, in <module><br>
zlib.error: Error -5 while decompressing data: incomplete or truncated stream<br></blockquote><div><br>This seemed peculiar, so I tried it out. Each time I wget all.z from that address, it's always a different one; I guess that's how it should be, but it seems that sometimes not all of it gets downloaded (hence the actually legit zlib error.)<br>


<br>I was able to make it work after my second download attempt (with your exact code); zlib handles it well. So far it's worked every time since.<br><br>This is probably not good if the source may sometimes deliver an incomplete stream.<br>


<br>TL;DR try wget'ing multiple times and getting even more puzzled (?)<br></div></div>