views:

271

answers:

3

Hello, I can't seem to get the wsgiref module to work at all under Python 3.0. It works fine under 2.5 for me, however. Even when I try the example in the docs, it fails. It fails so hard that even if I have a print function above where I do: "from wsgiref.simple_server import make_server", it never gets printed for some reason. It doesn't thow any errors when run, and it just displays a blank page in the browser and doesn't log any sort of request.

Does anybody know what the problem may be? Thanks!

+1  A: 

issue 4718:wsgiref package totally broken. sorry about that.

SilentGhost
But it will be fixed in 3.0.1!
Benjamin Peterson
Wow that is incredibly lame that they released Python 3.0 with a COMPLETELY broken package. Hell, they should have at least removed it until they could fix it.
Evan Fosmark
There's no point in removing a package to put in back in a x.x.1 release. Just wait until 2009-2-13.
Benjamin Peterson
A: 

I ended up applying the patch issued in 4718. I wrote up a tutorial here if anybody us interested on how to do it. Basically just run this once you download it:

sudo patch < wsgiref.patch
Evan Fosmark
A: 

You're in uncharted territory with WSGI on Python 3.0 I'm afraid.

WEB-SIG knew long ago that wsgiref was broken going into 3.0, but chose to do nothing about it. The spec hasn't been updated to cope with 3.0; pushing WSGI forwards even for the things everyone pretty-much agrees on is just agonisingly slow. It's depressing and senseless.

So yeah, it's easy to fix the obvious error with header unpacking in simple_server, but you'll still be running on a server that has been converted from Python 2-to-3 automatically and not really tested, with no de-jure standard to say exactly what it should do... never mind framework compatibility.

Python 3.0 for web scripting: needs some work.

bobince