parameters: (environ)
return_statement: return env1x
docstring: Return a new environ dict for WSGI 1.x from the given WSGI u.x environ.
docstring_summary: Return a new environ dict for WSGI 1.x from the given WSGI u.x environ.
docstring_tokens: Return a new environ dict for WSGI 1 . x from the given WSGI u . x environ .
function: 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
function_tokens: 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