(environ)
return env1x
Return a new environ dict for WSGI 1.x from the given WSGI u.x environ.
Return a new environ dict for WSGI 1.x from the given WSGI u.x environ.
Return a new environ dict for WSGI 1 . x from the given WSGI u . x environ .
def downgrade_wsgi_ux_to_1x(environ):
    """Return a new environ dict for WSGI 1.x from the given WSGI u.x environ.
    """
    env1x = {}

    url_encoding = environ[ntou('wsgi.url_encoding')]
    for k, v in list(environ.items()):
        if k in [ntou('PATH_INFO'), ntou('SCRIPT_NAME'), ntou('QUERY_STRING')]:
            v = v.encode(url_encoding)
        elif isinstance(v, str):
            v = v.encode('ISO-8859-1')
        env1x[k.encode('ISO-8859-1')] = v

    return env1x
def downgrade_wsgi_ux_to_1x ( environ ) : env1x = { } url_encoding = environ [ ntou ( 'wsgi.url_encoding' ) ] for k , v in list ( environ . items ( ) ) : if k in [ ntou ( 'PATH_INFO' ) , ntou ( 'SCRIPT_NAME' ) , ntou ( 'QUERY_STRING' ) ] : v = v . encode ( url_encoding ) elif isinstance ( v , str ) : v = v . encode ( 'ISO-8859-1' ) env1x [ k . encode ( 'ISO-8859-1' ) ] = v return env1x