[New-bugs-announce] [issue3497] a bug in the interpreter?

vadim suvorov report at bugs.python.org
Sun Aug 3 21:35:56 CEST 2008


New submission from vadim suvorov <zzPythonTracker at stelary.com>:

The result of the attached script execution is extremely unstable. The
change in the print statement in line 146 from 'print "1"' to 'print 1'
(string literal to numerical) changes the result of execution to the
correct (presumably) one. The results are also affected by commenting
out calls to empty method in lines 143 or 227. The use of dis.dis()
affects results of the execution as well. More than, the location of
error (the triggered assert) shifts in the code, or it is possible that
an Exception is raised.

The script was tested in Python 2.5.2 in Windows XP SP2 and SP3,
2.6beta2 in Windows XP SP3 and in 2.5.2 Ubuntu 8.0.4 with consistent
results. (I mean that behavior of the script is changed by calling of
empty methods or irrelevant print statements. The assert shifts.)

Sorry for the long script. I failed to further reduce its size because
effect disappears.

Expected output:
~~~~~~~~~~~~~~~~~~~~~
1
1
1
1
1
1
1
1
1
1
1
1
Congratulations: grid solved!
    1 2 3 4 5 6 7 8 910
 1  B B B B B . B . . B
 2  . B . . B B B B . B
 3  . . . . . B B . B B
 4  . . . B B B B B B .
 5  B . B B B . . B B B
~~~~~~~~~~~~~~~~~~~~~


Received output (example):
~~~~~~~~~~~~~~~~~~~~~
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
Traceback (most recent call last):
  File "E:\pet projects\nonograms\nonogramsolver10.py", line 244, in
<module>
    g.solve()
  File "E:\pet projects\nonograms\nonogramsolver10.py", line 230, in solve
    seq.simplescan()
  File "E:\pet projects\nonograms\nonogramsolver10.py", line 99, in
simplescan
    assert self.clues, "a seq with no clues"
AssertionError: a seq with no clues
~~~~~~~~~~~~~~~~~~~~~

----------
components: Interpreter Core
files: nonogramsolver10.py
messages: 70658
nosy: bad
severity: normal
status: open
title: a bug in the interpreter?
type: behavior
versions: Python 2.5, Python 2.6
Added file: http://bugs.python.org/file11045/nonogramsolver10.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3497>
_______________________________________


More information about the New-bugs-announce mailing list