[mod_python] Broken pipe

Nicolas Lehuen nicolas.lehuen at gmail.com
Wed Jan 26 13:49:04 EST 2005


The working directory of a published module is /, therefore your file
can't be found. Try putting an absolute path, then if it works, try
building the path based on the __file__ global variable :
os.path.dirname(__file__)+os.sep+'tutu.eps'

Regards,
Nicolas


On Wed, 26 Jan 2005 16:31:02 +0100, Lionel Roubeyrie
<lroubeyrie at limair.asso.fr> wrote:
> Hi all,
> I need to transform a .eps file into a .jpg or .png file. Using a simple
> script with the PIL works fine:
> #################################
> def convert(infile, outfile):
>     import Image
>     fp = Image.open(infile)
>     fp.save(outfile)
>     return outfile
> #################################
> 
> then convert('tutu.eps', 'tutu.jpg') is ok, not if I call it in mod_python:
> #################################
> File "/home/lionel/cartair.py", line 502, in convert
>     fp.save(outfile)
>   File "/usr/lib/python2.3/site-packages/PIL/Image.py", line 1125, in save
>     self.load()
>   File "/usr/lib/python2.3/site-packages/PIL/EpsImagePlugin.py", line 282, in
> load
>     self.im = Ghostscript(self.tile, self.size, self.fp)
>   File "/usr/lib/python2.3/site-packages/PIL/EpsImagePlugin.py", line 73, in
> Ghostscript
>     gs.write(s)
> IOError: [Errno 32] Broken pipe
> #################################
> Do I have to change something?
> Thanks
> 
> --
> Lionel Roubeyrie - lroubeyrie at limair.asso.fr
> LIMAIR
> http://www.limair.asso.fr
> 
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
>


More information about the Mod_python mailing list