Fatal Python error: unknown scope for...

Jeff Epler jepler at unpythonic.net
Tue Aug 5 21:47:05 EDT 2003


Confirmed in a local build (from CVS?), "Python 2.3b1 (#16, May 19 2003,
10:22:28)".  I would swear this was discussed at some point, so there's
a small chance it was fixed in 2.3.  In any case, it's only happening in
the presence of another (syntax) error so it's not as bad as it could be
(but still bad for eg "restricted execution" environments, which 2.3
tells us don't work anyway)

The following program shows a similar error (it's about the simplest
program I could devise with the problem):
	def g(a=None, b, c=lambda: None): g
"""Fatal Python error: unknown scope for g in g(1) in marek.py"""

This program doesn't:
	def g(a=None, b=None, c=lambda: None): g
note the definition of default arg 'b'.

This program dies with the syntax error, not the fatal internal error:
	def g(a=None, b, c=None): g
"""SyntaxError: non-default argument follows default argument"""

Jeff





More information about the Python-list mailing list