Skip to content

Commit

Permalink
[MRG+1] Update _monkeypatches.py (#3907)
Browse files Browse the repository at this point in the history
* Update _monkeypatches.py

The workarounds are not required assuming the bugs regarding urlparse are absent in  Python versions >2.7. We already exit the program if Python  version<2.7 in the __init__.py(line 17).The monkeypatches are deployed after this check at line 27  in  the __init__.py .

* Update _monkeypatches.py

Added the second workaround.

* Update _monkeypatches.py

* Update _monkeypatches.py
  • Loading branch information
sbs2001 authored and kmike committed Aug 1, 2019
1 parent cdf7889 commit 783d61d
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions scrapy/_monkeypatches.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@

if six.PY2:
from urlparse import urlparse

# workaround for https://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 https://bugs.python.org/issue9374 - Python < 2.7.4
if urlparse('s3://bucket/key?key=value').query != 'key=value':
from urlparse import uses_query
Expand Down

0 comments on commit 783d61d

Please sign in to comment.