mirror of https://github.com/scrapy/scrapy.git
Modified canonicalize_url to make it always work with regular strings
--HG-- extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%40433
This commit is contained in:
parent
8eab5802cd
commit
0958eecfca
|
|
@ -138,6 +138,7 @@ def canonicalize_url(url, keep_blank_values=False, keep_fragments=False):
|
|||
For examples see the tests in scrapy.tests.test_utils_url
|
||||
"""
|
||||
|
||||
url = str(url) # URLs *must* be a string; otherwise urllib may fail.
|
||||
parts = list(urlparse.urlparse(url))
|
||||
keyvals = cgi.parse_qsl(parts[4], keep_blank_values)
|
||||
keyvals.sort()
|
||||
|
|
|
|||
Loading…
Reference in New Issue