Thanks for reporting this Frank!  Looks like a legit bug to me, and I've filed 
it on CodePlex - see 
http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=25994.

Dave

-----Original Message-----
From: users-boun...@lists.ironpython.com 
[mailto:users-boun...@lists.ironpython.com] On Behalf Of see_toro...@web.de
Sent: Wednesday, January 20, 2010 12:20 AM
To: users@lists.ironpython.com
Subject: [IronPython] Strange error using settrace - help needed

Hi,
probably I'm just not experienced enough with IP to see what's going wrong.
If I run a script using ipy.exe and add the standard Python Lib folder to 
sys.path,
I can use "import os".
If I do the same, but issue an sys.settrace prior to the import the executions 
failes
with an index out of range error.

Here's a sample code:
-------------------------------------------------
def trace(frame, event, arg):
   return trace

import sys
sys.path.append('C:\Python26\Lib') # Python 2.6.4

sys.settrace(trace)
print 'Out 1'
import os
print 'Out 2'
-------------------------------------------------

Actually I'm trying to embedd Python scripts into a C# project and to trace the 
execution.
The error showed up in that context first, but it can be reproduced with the 
above code and
ipy.exe as well.

Does anyone have an idea what's going wrong here?
Many thanks for your help
Frank


___________________________________________________________
Preisknaller: WEB.DE DSL Flatrate für nur 16,99 Euro/mtl.! 
http://produkte.web.de/go/02/

_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to