Problem importing in a cgi script

Justin Shaw wyojustin at hotmail.com
Thu Jul 18 01:32:54 EDT 2002


I printed out the tb info to help troubleshoot:
Traceback (most recent call last):
File "gnuplot_cgi.py", line 4, in ?
  import cgi
...
...
File "/usr/local/lib/python2.2/socket.py", line 41, in ?
  from _socket import *
Import Error: ld.so.1: /usr/local/bin/python: fatal: libgcc_s.so.1: open
failed:

I was able to work around the issue by changing the CGIHTTPServer.py so that
it routes through the

elif self.have_popen2:
  ...                                          # branch bypassing the
if self.have_fork:
  ...

branch of CGIHTTPRequestHandler.run_cgi()

I still would like to track down the cause.  If you can shed any light I'd
appreciate it.

Thanks.
Justin


"Justin Shaw" <wyojustin at hotmail.com> wrote in message
news:De3Z8.138349$Bt1.7336244 at bin5.nnrp.aus1.giganews.com...
> After upgrading to Solaris 8 my cgi scripts are unable to import some
> modules.  The code runs standalone but not when called as a cgi script.  I
> was able to isolate the problem to these short scripts:
>
> #!/usr/local/bin/python
> # test_cgi.py
> import socket
> print 'OK!'
>
> # cgi_server_like.py
> import os
> os.execve('test_cgi.py', ('',), {})
>
> Too bad I don't have the actual traceback.  I look like the loader can't
> find _socket.so.  I've done runs where I print sys.path right before the
> import showing that the directory where _socket.so resides is in there.
Any
> ideas?
>
>
> OS: Solaris 8
> Python version: 2.2
>
>





More information about the Python-list mailing list