#5 Occasionally get a KeyError

closed-works-for-me
nobody
None
5
2003-03-13
2003-03-10
Pankaj K Garg
No

Hi:

I've been playing around with Spyce recently, and love
its capabilities. Was quite frustrated with using a
template-based
approach for a while.

Before I deploy it in a production environment,
however, I need to get the following debugged:

On some occasions, I get a KeyError with Spyce v1.3.9
running with mod_fastcgi. Normally, the same code works
fine. Infact, the KeyError goes away when I re-try.
When it comes, the KeyError complains about different
Keys. Looks like the error is with the 'include'
module. Here's an example:

Spyce exception
File: index.spy
Message: KeyError: (17, 'code')

Stack: index.spy:30, in (main):
include.spyce(cpage)

/opt/spyce/modules/include.py:26, in spyce:
code = self._api.spyceFile(file)

/opt/spyce/spyce.py:517, in spyceFile:
return getServer().spyce_cache[('file', file)]

/opt/spyce/spyceCache.py:131, in __getitem__:
return self.get(key)

/opt/spyce/spyceCache.py:121, in get:
self.cache[key] = self.generate(key)

/opt/spyce/spyce.py:583, in spyceCacheGenerate:
return {

/opt/spyce/spyce.py:561, in spyceFileCacheGenerate:
s = spyceCode(code, filename=filename)

/opt/spyce/spyce.py:329, in __init__:
self._code, self._coderefs, self._modrefs = \

/opt/spyce/spyceCompile.py:963, in spyceCompile:
ast, libs = parser.processFile(buf, filename, sig)

/opt/spyce/spyceCompile.py:211, in processFile:
self.processSpyceList(ast, spyceParser.parseSpyce(buf,
self._server.lock))

/opt/spyce/spyceParser.py:375, in parseSpyce:
result = parser.parse(debug=0,lexer=lexer)

/opt/spyce/yacc.py:328, in parse:
statestack.append(goto[statestack[-1],pname])

Discussion

  • batripler
    batripler
    2003-03-13

    Logged In: YES
    user_id=371556

    Consulted with Pankaj: we were unable to replicate after a
    'make clean'.

     
  • batripler
    batripler
    2003-03-13

    • status: open --> closed-works-for-me