[Python-bugs-list] [ python-Bugs-609041 ] test_b1.py, disabling of list test
noreply@sourceforge.net
noreply@sourceforge.net
Fri, 13 Sep 2002 11:58:02 -0700
Bugs item #609041, was opened at 2002-09-13 21:54
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=609041&group_id=5470
Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Christos Georgiou (tzot)
Assigned to: Nobody/Anonymous (nobody)
Summary: test_b1.py, disabling of list test
Initial Comment:
Guido disabled the list(xrange(sys.maxint / 4)) test
for 64-bit machines because PySequence_Length returns
an int and not ssize_t.
The test needs not be disabled; for the time being, it
should be
list(xrange(min(sys.maxint / 4, 0x1fffffff)))
There is another flaw, btw.
I ran the test on a 512MB RAM 64bit machine, and it passed.
However, when I ran it on a 16GB RAM 64bit machine, it
raised TestFailed incorrectly(!), because the statement
did not produce a MemoryError... I think this is
probably the only occasion the 'else' part was ever
evaluated (but ICBW :)
I did not supply a patch, because I didn't want to mess
with Guido's comments.
<HUMOUR>
Perhaps the test should be just:
try:
list(xrange(min(sys.maxint / 4, 0x1fffffff)
except MemoryError:
pass
else:
print "I wish this passed in my home machine too..."
</HUMOUR>
----------------------------------------------------------------------
>Comment By: Christos Georgiou (tzot)
Date: 2002-09-13 21:58
Message:
Logged In: YES
user_id=539787
I did indent the humourous code above, but the indentation
got lost after posting. Just in case the code was actually
used... :)
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=609041&group_id=5470