bug in the debuggers (pdb and wdb): Can't single step object creation

Steve Kirsch (stk@infoseek.com)
Mon, 28 Feb 1994 20:01:06 +0800

If you step through object creation in the debugger,
it tries to print the object before it has been fully initialized.

Similar errors happen if you try stepping through the
Date class initialization.

The error only happens if you are using the debugger and stepping.

-steve

corp% python
Python 1.0.1 (Feb 21 1994)
Copyright 1991-1994 Stichting Mathematisch Centrum, Amsterdam
>>> import pdb
>>> import pipes
>>> pdb.run('pipes.Template()')
> <string>(0)
(Pdb) s
> <string>(1)
(Pdb) s
> AttributeError: 'steps'
> <string>(1)
(Pdb) where
> <string>(1)

Traceback (innermost last):
File "<stdin>", line 1
File "/a/lib/python/pdb.py", line 282
Pdb().run(statement)
File "/a/lib/python/bdb.py", line 243
self.runctx(cmd, dict, dict)
File "/a/lib/python/bdb.py", line 250
exec(cmd + '\n', globals, locals)
File "<string>", line 1
File "/a/lib/python/bdb.py", line 35
return self.dispatch_exception(frame, arg)
File "/a/lib/python/bdb.py", line 65
self.user_exception(frame, arg)
File "/a/lib/python/pdb.py", line 52
self.interaction(frame, exc_traceback)
File "/a/lib/python/pdb.py", line 59
self.cmdloop()
File "/a/lib/python/cmd.py", line 24
stop = self.onecmd(line)
File "/a/lib/python/cmd.py", line 42
return func(arg)
File "/a/lib/python/pdb.py", line 113
self.print_stack_trace()
File "/a/lib/python/pdb.py", line 266
self.print_stack_entry(frame_lineno)
File "/a/lib/python/pdb.py", line 276
print self.format_stack_entry(frame_lineno)
File "/a/lib/python/bdb.py", line 228
s = s + repr.repr(args)
File "/a/lib/python/repr.py", line 15
return self.repr1(x, self.maxlevel)
File "/a/lib/python/repr.py", line 30
return f(x, level)
File "/a/lib/python/repr.py", line 38
s = s + self.repr1(x[i], level-1)
File "/a/lib/python/repr.py", line 24
s = `x`
File "/a/lib/python/pipes.py", line 95
return '<Template instance, steps=' + `self.steps` + '>'
AttributeError: steps
>>>

=======invoke pdb.pm()
(Pdb) up
> /a/lib/python/repr.py(24)repr1: s = `x`
(Pdb) x

*** AttributeError: steps
(Pdb) x.steps=3
(Pdb) x
<Template instance, steps=3>