[Zope-dev] zope.index 3.5.2 broken
Marius Gedminas
marius at gedmin.as
Mon Aug 3 12:38:44 EDT 2009
On Sun, Aug 02, 2009 at 08:48:24PM +0200, Andreas Jung wrote:
> Hi,
>
> the doctests for zope.index 3.5.2 - as used in Zope 2.12 - fail badly:
>
> File
> "/home/ajung/.buildout/eggs/zope.index-3.5.2-py2.6-linux-x86_64.egg/zope/index/text/tests/../textindex.txt",
> line 143, in textindex.txt
> Failed example:
> [(k, "%.4f" % v) for (k, v) in index2.apply("Zorro").items()] == result
I'm assuming items() returns a plain Python dictionary with string keys.
Python's string hashes return different valuesfor half of all the strings
on 64-bit machines. This influences the ordering of dictionary keys and
some other things too (such as the sequence of random numbers you get if
you use a string as the seed).
Add a sorted() on both sides and the test should pass.
Marius Gedminas
--
http://pov.lt/ -- Zope 3 consulting and development
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.zope.org/pipermail/zope-dev/attachments/20090803/07651736/attachment.bin
More information about the Zope-Dev
mailing list