"Internal Python error in the inspect module"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
IPython |
Fix Released
|
Undecided
|
Fernando Perez |
Bug Description
I was toying with IPython, and I've observed this bug:
[1]: def foo(a, (x,y,z) = (1,2,3)): print a, x, y, z
...:
[2]: foo(1,2)
ERROR: Internal Python error in the inspect module.
Below is the traceback from this internal error.
Traceback (most recent call last):
File "/var/lib/
locals,
File "/usr/lib/
specs.
File "/usr/lib/
return join(map(lambda o, c=convert, j=join: strseq(o, c, j), object))
File "/usr/lib/
return join(map(lambda o, c=convert, j=join: strseq(o, c, j), object))
File "/usr/lib/
return convert(object)
File "/usr/lib/
return formatarg(name) + formatvalue(
KeyError: 'x'
IPython's exception reporting continues...
-------
TypeError Traceback (most recent call last)
/home/harry/
/home/harry/
TypeError: 'int' object is not iterable
> <ipython console>(1)foo()
ipdb>
The regular Python interpreter just says:
>>> def foo(a, (x,y,z) = (1,2,3)):
... print a, x, y, z
...
>>> foo(1,2)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 1, in foo
TypeError: 'int' object is not iterable
This seems to be related to some IPython-specific functionality, although I have no understanding of its internals... I don't know if this error even matters at all, since there's already another one related to passing wrong arguments to a function - I'm just making sure someone knows that there's badness in that "inspect" module...
On Thu, Jul 17, 2008 at 10:51 AM, harry666t <email address hidden> wrote:
> Public bug reported:
>
> I was toying with IPython, and I've observed this bug:
>
> [1]: def foo(a, (x,y,z) = (1,2,3)): print a, x, y, z
> ...:
>
> [2]: foo(1,2)
> ERROR: Internal Python error in the inspect module.
> Below is the traceback from this internal error.
Great, thanks! I'd never had a reproducible test to cause this
failure. Having one now makes it possible to actually track the bug
down.
Best,
f