[reportlab-users] pyRXP - strange non-deterministic errors on python 2.7 and 64-bit Linux
Robin Becker
robin at reportlab.com
Wed May 18 05:24:03 EDT 2011
On 17/05/2011 17:36, Roger Whittaker wrote:
> On Tue, May 17, 2011 at 05:30:54PM +0100, Robin Becker wrote:
>
>> I'm not exactly sure what the above means
> [...]
>
>> are you expecting "./test.dtd" to work anywhere? If so I suspect
>> that it may be the shell that's causing the issue as it seems as
>> though relative path names get the current working directory added
>> into them.
>
> No - I copied everything into all the directories /tmp/a/,
> /tmp/ab/, /tmp/abc/, ... etc, and then I ran
> something like:
>
> for i in /tmp/a* ; do cd $i; ./process.py foo.xml; done 2> /home/roger/errors
>
> So I was always running from inside the directory where all the
> files were, and saw the errors only in some cases.
>
>
it's clear that the current working directory is being added to the filename
when the ./ form is used. That base url is obtained in the code at line 104 in
url.c.
Can you copy the attached version of url.c to the pyRXP.../rxp/ folder (over the
existing version). I have put some debugs into the code that's being used to get
the base url.
I have done the same on my x_64 vm when I run this command I see this
> for i in a aa;do (cd /home/robin/$i; python test.py foo.xml);done
> default_base_url: CWDBS=1025 cwd=/home/robin/a len=13
> default_base_url: url=file:///home/robin/a/
> url_merge: url=./test.dtd base=file:///home/robin/a/
> url_merge: merged_url=file:///home/robin/a/test.dtd
> url_merge: url=file:///home/robin/a/test.dtd base=(null)
> url_merge: merged_url=file:///home/robin/a/test.dtd
> url_merge: url=./first-file.xml base=file:///home/robin/a/
> url_merge: merged_url=file:///home/robin/a/first-file.xml
> url_merge: url=file:///home/robin/a/first-file.xml base=(null)
> url_merge: merged_url=file:///home/robin/a/first-file.xml
> url_merge: url=./second-longer-file.xml base=file:///home/robin/a/
> url_merge: merged_url=file:///home/robin/a/second-longer-file.xml
> url_merge: url=file:///home/robin/a/second-longer-file.xml base=(null)
> url_merge: merged_url=file:///home/robin/a/second-longer-file.xml
> default_base_url: CWDBS=1025 cwd=/home/robin/aa len=14
> default_base_url: url=file:///home/robin/aa/
> url_merge: url=./test.dtd base=file:///home/robin/aa/
> url_merge: merged_url=file:///home/robin/aa/test.dtd
> url_merge: url=file:///home/robin/aa/test.dtd base=(null)
> url_merge: merged_url=file:///home/robin/aa/test.dtd
> url_merge: url=./first-file.xml base=file:///home/robin/aa/
> url_merge: merged_url=file:///home/robin/aa/first-file.xml
> url_merge: url=file:///home/robin/aa/first-file.xml base=(null)
> url_merge: merged_url=file:///home/robin/aa/first-file.xml
> url_merge: url=./second-longer-file.xml base=file:///home/robin/aa/
> url_merge: merged_url=file:///home/robin/aa/second-longer-file.xml
> url_merge: url=file:///home/robin/aa/second-longer-file.xml base=(null)
> url_merge: merged_url=file:///home/robin/aa/second-longer-file.xml
> (bug000)robin at x-kitten001:~/devel/bug000/test$ pushd ../src/pyRXP-1.14/rxp/
ie everything appears normal when the ./xxx is converted into the file:// format
and the script is working fine.
--
Robin Becker
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: url.c
Url: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20110518/13501682/attachment-0001.ksh>
More information about the reportlab-users
mailing list