Can anyone reproduce this crash?

Alf P. Steinbach alfps at
Fri Apr 16 06:54:48 EDT 2010

Python 3.1.1 in Windows XP Prof:

<code filename="" language="Py3">
def number_from_user( prompt ):
     while True:
         spec = input( prompt )
             return float( spec )
         except ValueError:
             s = "Sorry, '{}' is not a valid number spec. Try e.g. '3.14'."
             print( s.format( spec ) )

print( "This program computes the sum of two numbers A and B." )
a = number_from_user( "Number A, please: " )
b = number_from_user( "Number B, please: " )
sum = a + b
print( "{} + {} = {}".format( a, b, sum ) )

To be thorough I tested the reaction to typing [Ctrl C] at the first prompt. It 
then displayed the first part of traceback output,

<output part="1">
C:\Documents and Settings\Alf>
This program computes the sum of two numbers A and B.

Number A, please: Traceback (most recent call last):

and seemingly hung for, I don't know, 20 seconds?, whereupon Microsoft's "Please 
tell Bill Gates about it" box popped up; the interpreter had crashed.

Regretfully declining the offer to tell Bill Gates, and this I don't quite 
understand, possibly buffer thing?, one more line of output then appeared:

<output part="2">
   File "C:\Documents and Settings\Alf\", line 13, in <module>

C:\Documents and Settings\Alf> _

In a normal traceback there are four more lines.

I thought I'd report this so I tried it several times more but unable to 
reproduce: instead of above hang + crash + truncated traceback the complete 
expected traceback appeared and the program terminated properly.

Can anyone reproduce?


- Alf

More information about the Python-list mailing list