<br>I'm seeing a dubious failure of test_gzip and test_tarfile on my AMD64 machine. It's triggered by the recent struct changes, but I'd say it's probably caused by a bug/misfeature in zlibmodule: zlib.crc32 is the result of a zlib 'crc32' functioncall, which returns an unsigned long. 
zlib.crc32 turns that unsigned long into a (signed) Python int, which means a number beyond 1&lt;&lt;31 goes negative on 32-bit systems and other systems with 32-bit longs, but stays positive on systems with 64-bit longs:
<br><br>(32-bit)<br>&gt;&gt;&gt; zlib.crc32(&quot;foobabazr&quot;)<br>-271938108<br><br>(64-bit)<br>&gt;&gt;&gt; zlib.crc32(&quot;foobabazr&quot;)<br>4023029188<br><br>The old structmodule coped with that:<br>&gt;&gt;&gt; 
struct.pack(&quot;&lt;l&quot;, -271938108)<br>'\xc4\x8d\xca\xef'<br>&gt;&gt;&gt; struct.pack(&quot;&lt;l&quot;, 4023029188)<br>'\xc4\x8d\xca\xef'<br><br>The new one does not:<br>&gt;&gt;&gt; struct.pack(&quot;&lt;l&quot;, -271938108)
<br>'\xc4\x8d\xca\xef'<br>&gt;&gt;&gt; struct.pack(&quot;&lt;l&quot;, 4023029188)<br>Traceback (most recent call last):<br>&nbsp; File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;<br>&nbsp; File &quot;Lib/struct.py&quot;, line 63, in pack
<br>&nbsp;&nbsp;&nbsp; return o.pack(*args)<br>struct.error: 'l' format requires -2147483647 &lt;= number &lt;= 2147483647<br><br>The structmodule should be fixed (and a test added ;) but I'm also wondering if zlib shouldn't be fixed. Now, I'm AMD64-centric, so my suggested fix would be to change the PyInt_FromLong() call to PyLong_FromUnsignedLong(), making zlib always return positive numbers -- it might break some code on 32-bit platforms, but that code is already broken on 64-bit platforms. But I guess I'm okay with the long being changed into an actual 32-bit signed number on 64-bit platforms, too.
<br><br>-- <br>Thomas Wouters &lt;<a href="mailto:thomas@python.org">thomas@python.org</a>&gt;<br><br>Hi! I'm a .signature virus! copy me into your .signature file to help me spread!