[Web-SIG] WSGI for Python 3

Graham Dumpleton graham.dumpleton at gmail.com
Sat Jul 17 12:07:01 CEST 2010


On Saturday, July 17, 2010, Ian Bicking <ianb at colorstudy.com> wrote:
> On Sat, Jul 17, 2010 at 12:38 AM, Graham Dumpleton <graham.dumpleton at gmail.com> wrote:
>
>
> On Friday, July 16, 2010, And Clover <and-py at doxdesk.com> wrote:
>> On 07/14/2010 06:43 AM, Ian Bicking wrote:
>>
>>
>> There's only a couple tricky keys: SCRIPT_NAME, PATH_INFO,
>> and HTTP_COOKIE.
>>
>>
>> (And of those, PATH_INFO is the only one that really matters, in that no-one really uses non-ASCII script filenames,
>
> FWIW, I had to go to a lot of trouble to allow non ASCII in final
> SCRIPT_NAME in mod_wsgi. Specifically using AddHandler directive in
> Apache means a file system path can make up part of SCRIPT_NAME. I had
> someone who was specifically using Russian in a WSGI script file name
> and because with AddHandler that becomes part of SCRIPT_NAME you had
> to cater for it. Anyway this was more of a Windows issue in having to
> use special file system functions to deal with fact that on Windows
> filesystem paths aren't UTF-8 but something else.
>
> What this does highlight though is that although one can talk about
> passing raw script name through to application, that isn't necessarily
> right as it isn't the application that dictates what encoding may be
> used but the web server which is performing the mapping of that part
> of the original URL path to a potential filesystem resource, or
> alternatively where file based configuration for mount point, the
> encoding of the web sever configuration file.
>
> This is an Apache-specific issue.  It definitely doesn't apply to paste.httpserver, I doubt CherryPy or wsgiref.  I don't really know how Nginx or other servers work.

The only reason it doesn't apply to paste.httpserver is because it
doesn't have a URL mapping system of it's own. That is, you host a
single WSGI application at the root of the server. Any server which
allows hosting of a WSGI application at a sub URL will have such
issues. Specifically, the details of the sub URL are worked out by the
server, be it by mapping a URL to the file system or through matching
to a configuration parameter in a server configuration file.


Graham


More information about the Web-SIG mailing list