python/dist/src/Lib/test string_tests.py, 1.41, 1.42
![](https://secure.gravatar.com/avatar/7b43f399ad17706bee01be8cd20165b0.jpg?s=120&d=mm&r=g)
Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26552/Lib/test Modified Files: string_tests.py Log Message: SF bug #1054139: serious string hashing error in 2.4b1 _PyString_Resize() readied strings for mutation but did not invalidate the cached hash value. Index: string_tests.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/string_tests.py,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- string_tests.py 27 Aug 2004 05:36:07 -0000 1.41 +++ string_tests.py 26 Oct 2004 01:52:36 -0000 1.42 @@ -80,6 +80,15 @@ args = self.fixtype(args) getattr(object, methodname)(*args) + def test_hash(self): + # SF bug 1054139: += optimization was not invalidating cached hash value + a = self.type2test('DNSSEC') + b = self.type2test('') + for c in a: + b += c + hash(b) + self.assertEqual(hash(a), hash(b)) + def test_capitalize(self): self.checkequal(' hello ', ' hello ', 'capitalize') self.checkequal('Hello ', 'Hello ','capitalize')
participants (1)
-
rhettingerīŧ users.sourceforge.net