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 hsmtkk
Recipients georg.brandl, hsmtkk
Date 2009-07-25.00:47:51
SpamBayes Score 1.2836556e-08
Marked as misclassified No
Message-id <1248482876.59.0.638608810535.issue6569@psf.upfronthosting.co.za>
In-reply-to
Content
Hello.
I found a bug in unittest sample code.
http://docs.python.org/dev/py3k/library/unittest.html#unittest-minimal-example
(naming this code as test_sample.py)

I got this error.
$ python3.2 test_sample.py
..E
======================================================================
ERROR: test_shuffle (__main__.TestSequenceFunctions)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_sample.py", line 11, in test_shuffle
    random.shuffle(self.seq)
  File
"/opt/local/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/random.py",
line 270, in shuffle
    x[i], x[j] = x[j], x[i]
TypeError: 'range' object does not support item assignment

----------------------------------------------------------------------
Ran 3 tests in 0.004s

I think this code should be fixed with attached patch.
Regards.
History
Date User Action Args
2009-07-25 00:47:57hsmtkksetrecipients: + hsmtkk, georg.brandl
2009-07-25 00:47:56hsmtkksetmessageid: <1248482876.59.0.638608810535.issue6569@psf.upfronthosting.co.za>
2009-07-25 00:47:54hsmtkklinkissue6569 messages
2009-07-25 00:47:53hsmtkkcreate