PIL, Python and CGI

Sascha Ferley Sascha.Ferley at infineon.net
Mon Jun 24 04:00:46 CEST 2002


On Mon, 24 Jun 2002, Richard Jones wrote:

> On Mon, 24 Jun 2002 11:30, Sascha Ferley wrote:
> > Thanks for replying back to me, this thing has been driving me nuts for a
> > while now. Anyways, i removed the try/catch block from the Image.py lib,
> > and checked the error output:
> >
> > Traceback (most recent call last):
> >   File "/export/server/web/CPSC461/cgi-bin/interfce.py", line 15, in ?
> >     print Image.open(urlretrieve(sourcePath, '/tmp/img1')[0]).histogram()
> >   File "/usr/local/lib/python2.2/site-packages/PIL/Image.py", line 577, in
> > histogram
> >     self.load()
> >   File "/opt/sfw/lib/python2.2/site-packages/PIL/ImageFile.py", line 126,
> > in load
> >     self.load_prepare()
> >   File "/opt/sfw/lib/python2.2/site-packages/PIL/ImageFile.py", line 180,
> > in load_prepare
> >     self.im = Image.core.new(self.mode, self.size)
> > AttributeError: 'module' object has no attribute 'core'
>
> "core" is assigned just after the "import _imaging" line in Image.py. Are you
> sure there isn't another traceback we're missing? What happens if you just
> have a simple CGI script that just does "import _imaging"?

Hi Richard

Thanks again, well here is what occurs,
program/script:

import sys
import _imaging

sys.stderr = sys.stdout
print "Content-Type: text/plain"
print sys.path


The error that results:

[Sun Jun 23 19:58:32 2002] [error] (8)Exec format error: exec of
/export/server/web/CPSC461/cgi-bin/test3.py failed
[Sun Jun 23 19:58:32 2002] [error] [client 136.159.3.51] Premature end of
script headers: /export/server/web/CPSC461/cgi-bin/test3.py

After 48hours of straight coding i might not have done the best job
here:).

Sascha






More information about the Python-list mailing list