Python 3.0 `wsgiref` server not functioning
-
20-08-2019 - |
Question
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!
Solution
issue 4718:wsgiref package totally broken. sorry about that.
OTHER TIPS
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.