diff -r c7235a4abdee Lib/cookielib.py --- a/Lib/cookielib.py Sun May 02 18:45:11 2010 +0200 +++ b/Lib/cookielib.py Sun May 02 16:35:28 2010 -0400 @@ -600,15 +600,19 @@ erhn = req_host + ".local" return req_host, erhn -def request_path(request): +def request_path(request, w_params=True, w_query=True, w_frag=True): """request-URI, as defined by RFC 2965.""" url = request.get_full_url() #scheme, netloc, path, parameters, query, frag = urlparse.urlparse(url) #req_path = escape_path("".join(urlparse.urlparse(url)[2:])) path, parameters, query, frag = urlparse.urlparse(url)[2:] - if parameters: + if parameters and w_params: path = "%s;%s" % (path, parameters) path = escape_path(path) + if not w_query: + query = "" + if not w_frag: + frag = "" req_path = urlparse.urlunparse(("", "", path, "", query, frag)) if not req_path.startswith("/"): # fix bad RFC 2396 absoluteURI @@ -1463,7 +1467,7 @@ path = escape_path(path) else: path_specified = False - path = request_path(request) + path = request_path(request, w_query=False, w_frag=False) i = path.rfind("/") if i != -1: if version == 0: