From 97b51ea33b6b96241ef87861619e6820ee9e765c Mon Sep 17 00:00:00 2001 From: Leonid Amirov Date: Tue, 3 Nov 2015 14:57:37 +0300 Subject: [PATCH] issue GH #1550 - six library is used instead of urlparse for python3 compatibility --- scrapy/commands/shell.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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)