"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes:

> I'm finally doing well, things are happening and then this error----I'm
> not even sure where to start debugging it.  The file at the end of the
> error doesn't even exist....all that exists is a .pyc compiled by kid
> (I assume).

Correct, Kid turns your .kid files into .py files, compiles those and
then deletes the .py files. Unfortunately the errors point to those
files... :-(

A starting point for debugging this would be to start your project
with as

  % KID_OUTPUT_PY=1 ./start-foo.py

Then Kid wont delete the generated .py files.

You'll see that the .py file generated is basically a transcript of
your .kid file turned into a stream of (event, value) pairs.

> I don't think I've changed my template for a while
> though....

Errors could also come from bad input being fed into Kid via its XML()
function. This function also turns it's argument into a stream and so
syntax errors only show up where the stream is evaluated.

But I think those errors would look different than yours, I'm talking
about stuff like this:

>>> from kid.pull import XML
>>> stream = XML('<foo>bar')        # No error here.
>>> list(stream)                    # Force evaluation => error.
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/var/lib/python-support/python2.4/kid/pull.py", line 119, in strip
    for (ev, item) in self._iter:
  File "/var/lib/python-support/python2.4/kid/pull.py", line 164, in _track
    for p in stream:
  File "/var/lib/python-support/python2.4/kid/pull.py", line 206, in _coalesce
    for ev, item in stream:
  File "/var/lib/python-support/python2.4/kid/pull.py", line 370, in __iter__
    for (ev, stuff) in self._expat_stream():
  File "/var/lib/python-support/python2.4/kid/pull.py", line 342, in 
_expat_stream
    feed(data)
  File "/var/lib/python-support/python2.4/kid/pull.py", line 410, in feed
    raise e
xml.parsers.expat.ExpatError: mismatched tag: line 1, column 15


>   File "/home/me/ws/xstart/xstart/templates/pattern_match.py", line
> 112, in _pull
> KeyError: 5

Looking at the code around that line might give you a clue as to what
is going wrong.

-- 
Martin Geisler  ---  <[EMAIL PROTECTED]>  ---  http://mgeisler.net

Read, write, create Exif data in PHP with PEL:       http://pel.sf.net
Take control of your webserver with PHP Shell:  http://phpshell.sf.net

Attachment: pgp4Hw9yovtST.pgp
Description: PGP signature

Reply via email to