[Web-SIG] A more useful command-line wsgiref.simple_server?
PJ Eby
pje at telecommunity.com
Sat Mar 31 05:36:12 CEST 2012
On Fri, Mar 30, 2012 at 5:12 PM, Graham Dumpleton <
graham.dumpleton at gmail.com> wrote:
> Now when doing mod_wsgi, a similar method of loading each file
>
separately with a __name__ based on file system path was used to
> ensure each was distinct when same file name used in different
> directories.
>
Why give them a __name__ at all? Aren't they scripts, rather than modules?
ISTM that not having a __name__ would also let things like pickles fail
faster. That is, code that expected a module rather than a script would
break right away.
FWIW, in the past when pushing the idea of a WSGI script file being
> the lowest common denominator, part of the reason I found I couldn't
> get it accepted is that some people simply didn't understand how in
> Python to load an arbitrary file by path name and construct a module
> for it in memory, with magic __name__. They seemed to think that the
> only way to import a code file was for it to have a .py extension and
> for the directory to be in sys.path. So, due to ignorance of the
> solution as to how to do it meant I got a push back from some people.
>
Who were you trying to get acceptance from? Web-SIG or Python-Dev?
Framework devs or end-users? Is there a PEP?
If implementation is a problem for people, could we just include a wsgiref
utility for it?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/web-sig/attachments/20120330/b3700903/attachment.html>
More information about the Web-SIG
mailing list