[reportlab-users] pyRXP - strange non-deterministic errors on python 2.7 and 64-bit Linux

Roger Whittaker roger at disruptive.org.uk
Mon May 16 10:27:44 EDT 2011


On Mon, May 16, 2011 at 10:01:26AM +0100, Robin Becker wrote:


> Another approach might be to try passing an entity opening callback

> into the parser that could be used to try and see what information

> is being parsed to obtain the entity.


Using your code

$ cat withcallback.py
#! /usr/bin/env python
from pyRXP import Parser
infile = open(argv[1], 'r').read()
p = Parser()
def eoCB(entity):
print 'eoCB(%r)' % entity
return entity
parsed = p.parse(infile,eoCB=eoCB)

roger at snark: /tmp/abcd $ ./withcallback.py foo.xml
eoCB('./test.dtd')
eoCB('./first-file.xml')
eoCB('./second-longer-file.xml')
/tmp/abcd/secondonger-fifile.xml: No such file or directory
Traceback (most recent call last):
File "./withcallback.py", line 9, in <module>
parsed = p.parse(infile,eoCB=eoCB)
pyRXP.error: Error: Couldn't open entity b, file:///tmp/abcd/secondonger-fifile.xml
in unnamed entity at line 10 char 8 of [unknown]
Couldn't open entity b, file:///tmp/abcd/secondonger-fifile.xml
Parse Failed!


--
========================
Roger Whittaker
roger at disruptive.org.uk
http://disruptive.org.uk
========================


More information about the reportlab-users mailing list