def pop_path_info(environ, charset='utf-8', errors='replace'):
 path = environ.get('PATH_INFO')
 if (not path):
  return None
 script_name = environ.get('SCRIPT_NAME', '')
 old_path = path
 path = path.lstrip('/')
 if (path != old_path):
  script_name += ('/' * (len(old_path) - len(path)))
 if ('/' not in path):
  environ['PATH_INFO'] = ''
  environ['SCRIPT_NAME'] = (script_name + path)
  rv = wsgi_get_bytes(path)
 else:
  (segment, path) = path.split('/', 1)
  environ['PATH_INFO'] = ('/' + path)
  environ['SCRIPT_NAME'] = (script_name + segment)
  rv = wsgi_get_bytes(segment)
 return to_unicode(rv, charset, errors, allow_none_charset=True)

def pop_path_info ( environ , charset = 'utf-8' , errors = 'replace' ) : path = environ . get ( 'PATH_INFO' ) if ( not path ) : return None script_name = environ . get ( 'SCRIPT_NAME' , '' ) old_path = path path = path . lstrip ( '/' ) if ( path != old_path ) : script_name += ( '/' * ( len ( old_path ) - len ( path ) ) ) if ( '/' not in path ) : environ [ 'PATH_INFO' ] = '' environ [ 'SCRIPT_NAME' ] = ( script_name + path ) rv = wsgi_get_bytes ( path ) else : ( segment , path ) = path . split ( '/' , 1 ) environ [ 'PATH_INFO' ] = ( '/' + path ) environ [ 'SCRIPT_NAME' ] = ( script_name + segment ) rv = wsgi_get_bytes ( segment ) return to_unicode ( rv , charset , errors , allow_none_charset = True )
removes and returns the next segment of path_info .