From: Marcos P. <msa...@gr...> - 2002-12-10 06:20:18
|
Is the SYBASE env var set when run from CGI? El vie, 06-12-2002 a las 18:51, Tony Burger escribi=F3: > This is kinda wierd. This works just fine when run from the command line=20 > using "python script_name.py" but blows up when run in a CGI fashion. Any= =20 > ideas why it can't find "comn_free"? > ###################################################################### > #!/usr/bin/python >=20 > import Sybase >=20 > def getDatabases(): > db=3DSybase.connect('srv','sa','pwd',database=3D'db',auto_commit=3D1) > c=3Ddb.cursor() > c.execute('select * from corp_defects_td_databases order by=20 > database_report_name asc') > varDatabases=3D{} > for row in c.fetchall(): > varDatabases.setdefault(row[0],[]).append(row[1]) > varDatabases.setdefault(row[0],[]).append(row[2]) > c.close() > db.close() > outputHTML=3D"Content-type: text/html\n\n" > outputHTML+=3D""" > <html> > <body><center> > <h5>test</h5> > </center></body> > </html>""" > return outputHTML >=20 > if __name__ =3D=3D "__main__": > print getDatabases() > ###################################################################### > Error Log: >=20 > [error] Premature end of script headers: corp_defect_admin.py > [error] Traceback (most recent call last): > [error] File "/home/tonyb/html/cgi-bin/corp_defect_admin.py", line 3, in = ? > [error] import Sybase > [error] File=20 > "/usr/local/python-threads/lib/python2.2/site-packages/Sybase.py", line 2= 0,=20 > in ? > [error] from sybasect import * > [error] ImportError: /usr/local/sybase/lib/libcomn.so: undefined symbol:=20 > comn_free >=20 > Thanks. >=20 >=20 > _________________________________________________________________ > Protect your PC - get McAfee.com VirusScan Online=20 > http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3D3963 >=20 > _______________________________________________ > Python-sybase mailing list > Pyt...@ob... > https://object-craft.com.au/cgi-bin/mailman/listinfo/python-sybase --=20 Marcos S=E1nchez Provencio <msa...@gr...> www.burke.es |