This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author belopolsky
Recipients asmodai, belopolsky, rhettinger
Date 2008-03-06.20:48:08
SpamBayes Score 0.012272314
Marked as misclassified No
Message-id <1204836490.07.0.80404182444.issue2246@psf.upfronthosting.co.za>
In-reply-to
Content
With the following patch:

===================================================================
--- Lib/test/test_itertools.py  (revision 61284)
+++ Lib/test/test_itertools.py  (working copy)
@@ -707,6 +707,12 @@
         a = []
         self.makecycle(takewhile(bool, [1, 0, a, a]), a)
 
+    def test_issue2246(self):
+        n = 10
+        keyfunc = lambda x: x
+        for i, j in groupby(xrange(n), key=keyfunc):
+            keyfunc.__dict__.setdefault('x',[]).append(j)
+                    
 def R(seqn):
     'Regular generator'
     for i in seqn:

$ ./python Lib/test/regrtest.py -R :: test_itertools

reports n*3 + 13 reference leaks.  This should give a clue ...
History
Date User Action Args
2008-03-06 20:48:10belopolskysetspambayes_score: 0.0122723 -> 0.012272314
recipients: + belopolsky, rhettinger, asmodai
2008-03-06 20:48:10belopolskysetspambayes_score: 0.0122723 -> 0.0122723
messageid: <1204836490.07.0.80404182444.issue2246@psf.upfronthosting.co.za>
2008-03-06 20:48:09belopolskylinkissue2246 messages
2008-03-06 20:48:09belopolskycreate