Skip to content

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

fix urlparse monkeypatches for python 2.7.4. closes #144

Daniel Graña27689009f177
diff --git a/scrapy/xlib/urlparse_monkeypatches.py b/scrapy/xlib/urlparse_monkeypatches.py
index 5228b6551..fc37810d6 100644
--- a/scrapy/xlib/urlparse_monkeypatches.py
+++ b/scrapy/xlib/urlparse_monkeypatches.py
@@ -1,7 +1,11 @@
-from urlparse import urlparse, uses_netloc, uses_query
+from urlparse import urlparse
-# workaround for http://bugs.python.org/issue7904
+# workaround for http://bugs.python.org/issue7904 - Python < 2.7
if urlparse('s3://bucket/key').netloc != 'bucket':
+ from urlparse import uses_netloc
uses_netloc.append('s3')
+
+# workaround for http://bugs.python.org/issue9374 - Python < 2.7.4
if urlparse('s3://bucket/key?key=value').query != 'key=value':
+ from urlparse import uses_query
uses_query.append('s3')