[IronPython] problems with cgi scripts

R. Tyler Ballance tyler at monkeypox.org
Sun Jan 3 00:06:26 CET 2010


On Sat, 02 Jan 2010, Count L?szl? de Alm?sy wrote:

> there is no error. the httpd log shows a 200 response, i just get no
> data back. i've tried two different http servers as well, thttpd and
> bozohttpd with the same results. if i switch the top line in the
> script to point to CPython (#!/usr/bin/python) instead, it works fine.
> i forgot to mention this is on Linux/Mono, in case that makes any
> difference.

Your sh-bang is curious to me, since I normally run `mono ipy.exe`, have you
registered .exe as a non-native binary on your system?

http://www.mono-project.com/Guide:Running_Mono_Applications#Registering_.exe_as_non-native_binaries_.28Linux_only.29

The fact that without base64 your script works at all is curious to me, but
looking at the script the first thing that popped out was the sh-bang

> 
> On Sat, Jan 2, 2010 at 4:42 AM, Michael Foord <fuzzyman at voidspace.org.uk> wrote:
> >
> > What does your server error log say?
> >>
> >> is there any reason that IronPython is incompatible with CGI? i'm not
> >> able to run even the simplest of CGI programs when certain CPython
> >> modules are imported. for example, the following doesn't work - i
> >> simply get an empty response in the browser (and no errors):
> >>
> >> =============
> >>
> >> #!/usr/local/packages/IronPython-2.0.3/ipy.exe
> >>
> >> import base64
> >>
> >> print "Content-Type: text/html"
> >> print
> >> print "hello"
> >>
> >> =============
> >>
> >> however, if you remove the import of base64, it does work. importing
> >> certain modules such as 'sys' don't break it, but most do (substitute
> >> almost any CPython module for base64). it's not an issue with my
> >> sys.path, i can import these modules fine from the interpreter. i'd
> >> also think if it was an issue like that, i'd get an ImportError or
> >> something, not just empty output with no exception or error.
> >>
> >> any ideas?
> >>
> >>
> >
> > What does your server error log say?
> >
> > Michael
> >
> > --
> > http://www.ironpythoninaction.com/
> > http://www.voidspace.org.uk/blog
> >
> >
> > _______________________________________________
> > Users mailing list
> > Users at lists.ironpython.com
> > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
> >
> 
> 
> 
> -- 
> Cheers, László
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Cheers,
-R. Tyler Ballance
--------------------------------------
 Jabber: rtyler at jabber.org
 GitHub: http://github.com/rtyler
Twitter: http://twitter.com/agentdero
   Blog: http://unethicalblogger.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20100102/b203aba4/attachment.pgp>


More information about the Ironpython-users mailing list