From c065f2c92236d1680f88dea63ad7111ff04703da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gra=C3=B1a?= Date: Mon, 18 Jun 2012 11:50:43 -0300 Subject: [PATCH] fix urlparse monkeypatches for python 2.7.4. closes #144 --- scrapy/xlib/urlparse_monkeypatches.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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')