Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal Python error in the inspect module #53

Closed
ipython opened this issue May 10, 2010 · 3 comments
Closed

Internal Python error in the inspect module #53

ipython opened this issue May 10, 2010 · 3 comments
Milestone

Comments

@ipython
Copy link
Collaborator

ipython commented May 10, 2010

Original Launchpad bug 249548: https://bugs.launchpad.net/ipython/+bug/249548
Reported by: harry666t (harry666t).

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/python-support/python2.5/IPython/ultraTB.py", line 662, in text
  locals,formatvalue=var_repr))
File "/usr/lib/python2.5/inspect.py", line 812, in formatargvalues
  specs.append(strseq(args[i], convert, join))
File "/usr/lib/python2.5/inspect.py", line 765, in strseq
  return join(map(lambda o, c=convert, j=join: strseq(o, c, j), object))
File "/usr/lib/python2.5/inspect.py", line 765, in <lambda>
  return join(map(lambda o, c=convert, j=join: strseq(o, c, j), object))
File "/usr/lib/python2.5/inspect.py", line 767, in strseq
  return convert(object)
File "/usr/lib/python2.5/inspect.py", line 809, in convert
  return formatarg(name) + formatvalue(locals[name])
KeyError: 'x'

IPython's exception reporting continues...

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

/home/harry/<ipython console> in <module>()

/home/harry/<ipython console> in foo(***failed resolving arguments***)

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...

@ipython
Copy link
Collaborator Author

ipython commented May 10, 2010

[ LP comment 1 by: Fernando Perez, on 2008-07-18 00:28:19+00:00 ]

On Thu, Jul 17, 2008 at 10:51 AM, harry666t harry666t@gmail.com 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
...:

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

@takluyver
Copy link
Member

This seems to have been fixed in trunk.

@minrk
Copy link
Member

minrk commented Mar 23, 2011

Yes, this is fixed in 0.11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants