[reportlab-users] pyRXP - strange non-deterministic errors on python 2.7 and 64-bit Linux
Robin Becker
robin at reportlab.com
Mon May 16 11:02:48 EDT 2011
On 16/05/2011 15:27, Roger Whittaker wrote:
> 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!
>
>
tried this on the freebsd x64 without any error.
--
Robin Becker
More information about the reportlab-users
mailing list