Hi, On 03.07.06, [EMAIL PROTECTED] wrote: > I'am trying to run pyx under apache. But there seems to be some kind of > trouble with temporary files. E.g. the "Hello world" example script > (http://pyx.sourceforge.net/examples/index.html) gives the following > when I run it from a php-script > > Traceback (most recent call last): > File "/work2/antares-data//bin//test-pyx.py", line 6, in ? > c.text(0, 0, "Hello, world!") > File "/usr/lib/python2.3/site-packages/pyx/canvas.py", line 267, in > text > return self.insert(self.texrunner.text(x, y, atext, *args, > **kwargs)) > File "/usr/lib/python2.3/site-packages/pyx/text.py", line 1152, in > text > self.execute(expr, self.defaulttexmessagesdefaultrun + > self.texmessagesdefaultrun + texmessages) > File "/usr/lib/python2.3/site-packages/pyx/text.py", line 831, in > execute > texfile = open("%s.tex" % self.texfilename, "w") # start with > filename -> creates dvi file with that name > IOError: [Errno 13] Permission denied: 'tmpAM66YS.tex' > > The version of pyx 0.71on debian. Does anybody know why I get this > message?
Yes, there is a simple reason. PyX needs to communicate with TeX and due to limitations of TeX we need to use temporary files here. Those temporary files are created in the current directory (at the first text or preamble call). The reason is that you may want to refer to other sources relative to your current directory from within TeX and for that we stay where we are (think of using includegraphics to load a file in the current directory). We also can't use a different directory for the output in TeX while staying at the current directory, since TeX doesn't do that. (TeX basically strips the path from the jobname. Try to run "tex <somepath>/<somefile>.tex" and the output of TeX will be still be "<somefile>.dvi" in the current directory!) You could try to changedir into a directory, where you can write temporary files before you start with your real PyX work in the Python script. I havn't checked, but I think it should work well ... > And is it a good idea to run PyX under apache in general? > (I'am trying to replace gnuplo twith it) Well, PyX isn't exactly the fastest solution to create certain PostScript or PDF output. OTHO, if this doesn't really matter for you, there is no real problem. Anyway, you should *not* (*NEVER*) pass any free from text to the PyX text method. This is not a PyX problem itself, but a serious TeX problem. Somebody could run an "\input /etc/passwd" thru TeX to read out your passwords. While TeX itself doesn't allow you to be safe in that respect, the only chance would be to create a safe sand-box yourself using chroot or other techniques (which BTW works very well ... I'm doing the myself for certain projects). André -- by _ _ _ Dr. André Wobst / \ \ / ) [EMAIL PROTECTED], http://www.wobsta.de/ / _ \ \/\/ / PyX - High quality PostScript and PDF figures (_/ \_)_/\_/ with Python & TeX: visit http://pyx.sourceforge.net/ ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ PyX-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/pyx-user
