Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

issue GH #1550 - six library is used instead of urlparse for python3 compatibility

Leonid Amirov97b51ea33b6b
diff --git a/scrapy/commands/shell.py b/scrapy/commands/shell.py
index cb441bc9d..6f58a2300 100644
--- a/scrapy/commands/shell.py
+++ b/scrapy/commands/shell.py
@@ -4,8 +4,9 @@ Scrapy Shell
See documentation in docs/topics/shell.rst
"""
+import re
+from six.moves.urllib.parse import urlparse, urlunparse
from threading import Thread
-import urlparse
from w3lib.url import any_to_uri
from scrapy.commands import ScrapyCommand
@@ -45,7 +46,7 @@ class Command(ScrapyCommand):
def run(self, args, opts):
url = args[0] if args else None
if url:
- parts = urlparse.urlsplit(url)
+ parts = urlparse(url)
if not parts.scheme:
if "." not in parts.path.split("/", 1)[0]:
url = any_to_uri(url)