[Ironpython-users] IronPython, Daily Digest 8/19/2013

CodePlex no_reply at codeplex.com
Tue Aug 20 09:17:57 CEST 2013


Hi ironpython,

Here's your Daily Digest of new issues for project "IronPython".

In today's digest:ISSUES

1. [New issue] IronPython exception trace does not show actual offending line for certain case.

----------------------------------------------

ISSUES

1. [New issue] IronPython exception trace does not show actual offending line for certain case.
http://ironpython.codeplex.com/workitem/34386
User TRJG has proposed the issue:

"After spending about an hour attempting to figure out why a script would not run, I eventually narrowed down the issue (by stripping out all .NET related things and running it in python).

Turns out IronPython was not showing the full stacktrace for a very particular situation which is easily repeatable. The error occurs when attempting to use self to assign an argument in a class method. (Its not allowed).

Here is the simple class.

class MyClass:
def __init__(self):
    pass

def bad_method(self, arg=self.__method): # This is the offending Line
    pass

def __method(self):
    pass


Here are the results for both.

(IronPython) ipy test.py
Traceback (most recent call last):
  File "test.py", line 1, in <module>
NameError: global name 'self' is not defined

(Python 3.3) python test.py 
Traceback (most recent call last):
  File "test.py", line 1, in <module>
class MyClass:

File "test.py", line 7, in MyClass
def bad_method(self, arg=self.__method):

NameError: name 'self' is not defined


As one might understand, without that next traceline, finding the offending 'self' might be quite a difficult task. I'm not sure if this specific error tracing bug might effect other syntax checking or not, but this simple one was a doozy to debug.

Thanks."
----------------------------------------------



----------------------------------------------
You are receiving this email because you subscribed to notifications on CodePlex.

To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20130820/abdd171d/attachment.html>


More information about the Ironpython-users mailing list