[IronPython] Snippets in Trackback

Davy Mitchell daftspaniel at gmail.com
Sun Mar 30 14:20:23 CEST 2008


Hi Curt,

Yeah the errors are pretty trivial to fix - usually XAML typos and the
.Net detail is fine to fix it. I was just a little confused about
Snippets in the traceback but no reference to my 'test.py' file.

A better example is the single line 'self.test' saved to to test2.py

python test2.py
C:\Code\OSProjects>python test2.py
Traceback (most recent call last):
  File "test2.py", line 1, in <module>
    self.test
NameError: name 'self' is not defined

ipy test2.py
C:\Code\OSProjects>ipy test2.py
Traceback (most recent call last):
  File Snippets, line unknown, in Initialize
NameError: name 'self' is not defined

Cpython does a bit better there in callstack detail :-)

Davy

On Sun, Mar 30, 2008 at 12:41 PM, Curt Hagenlocher <curt at hagenlocher.org> wrote:
> This works for me once I fix the mismatched XML tag (and the mail-induced
> line breaks).  And when I don't, I get pretty explicit error messages as the
> text of the exception:
>
> SystemError: The 'DockPanel' start tag on line 4 does not match the end tag
> of 'DockPanelTest'. Line 5, position 3.
> -or-
> SyntaxError: EOL while scanning single-quoted string
>
> What was the exception that you were getting?
>
>
> On Sat, Mar 29, 2008 at 11:42 PM, Davy Mitchell <daftspaniel at gmail.com>
> wrote:
>
> > This has the desired effect:
> >
> > import clr
> > clr.AddReference("System.Xml")
> > clr.AddReference("PresentationFramework, Version=3.0.0.0,
> > Culture=neutral, PublicKeyToken=31bf3856ad364e35")
> > clr.AddReference("PresentationCore, Version=3.0.0.0, Culture=neutral,
> > PublicKeyToken=31bf3856ad364e35")
> > from System.IO import StringReader
> > from System.Xml import XmlReader
> > from System.Windows.Markup import XamlReader, XamlWriter
> > from System.Windows import Window, Application
> >
> > xaml = """
> > <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
> >        Title="Test" Width="600" Height="400">
> > <DockPanel>
> > </DockPanelTest>
> > </Window>
> > """
> >
> > xr = XmlReader.Create(StringReader(xaml))
> > win = XamlReader.Load(xr)
> > Application().Run(win)
> >
> >
> >
> >
> > On Sat, Mar 29, 2008 at 8:34 PM, Curt Hagenlocher <curt at hagenlocher.org>
> wrote:
> > > The "snippets" represent executable code that's generated dynamically by
> the
> > > DLR from your Python source.  Do you have a small piece of sample code
> that
> > > reproduces the failure?
> > >
> > >
> > >
> > > On Sat, Mar 29, 2008 at 1:28 PM, Davy Mitchell <daftspaniel at gmail.com>
> > > wrote:
> > >
> > > >
> > > >
> > > >
> > > > Hi All,
> > > >
> > > > IPY2.0 B1 Vista SP1
> > > >
> > > > I keep seeing reference to 'Snippets' in IP Tracebacks on different
> > > > bits of code. Can't find anything on codeplex so assume it *probably*
> > > > something wrong this end.
> > > > I don't have a 'Snippets' module AFAIK.
> > > >
> > > > Typical example
> > > > C:\Code\OSProjects>ipy wpf5.py
> > > > Traceback (most recent call last):
> > > >  File Snippets, line unknown, in Initialize
> > > >  File PresentationFramework, line unknown, in Load
> > > >
> > > > Is it just me or.... :-)
> > > >
> > > > --
> > > >
> > > >
> > > >
> > > > Davy Mitchell
> > > > Blog - http://www.latedecember.co.uk/sites/personal/davy/
> > > > Twitter - http://twitter.com/daftspaniel
> > > > Skype - daftspaniel needgod.com
> > > > _______________________________________________
> > > > Users mailing list
> > > > Users at lists.ironpython.com
> > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
> > > >
> > >
> > >
> > > _______________________________________________
> > >  Users mailing list
> > >  Users at lists.ironpython.com
> > >  http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
> > >
> > >
> >
> >
> >
> > --
> >
> >
> >
> > Davy Mitchell
> > Blog - http://www.latedecember.co.uk/sites/personal/davy/
> > Twitter - http://twitter.com/daftspaniel
> > Skype - daftspaniel needgod.com
> > _______________________________________________
> > Users mailing list
> > Users at lists.ironpython.com
> > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
> >
>
>
> _______________________________________________
>  Users mailing list
>  Users at lists.ironpython.com
>  http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
>



-- 
Davy Mitchell
Blog - http://www.latedecember.co.uk/sites/personal/davy/
Twitter - http://twitter.com/daftspaniel
Skype - daftspaniel needgod.com



More information about the Ironpython-users mailing list