Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MRG+1] Update _monkeypatches.py #3907

Merged
merged 4 commits into from
Aug 1, 2019
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 2 additions & 7 deletions scrapy/_monkeypatches.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,13 @@

if six.PY2:
from urlparse import urlparse

# workaround for https://bugs.python.org/issue7904 - Python < 2.7
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we shouldn't remove the second workaround, as it may be needed in 2.7 < Python < 2.7.4

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep my bad, python 2.7.4 is still permitted . I am newbie to the whole project so this may sound stupid but why is the Travis CI build is failing? I noticed it with other pull requests too.

Copy link
Contributor Author

@sbs2001 sbs2001 Jul 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the second workaround in the new commit.Could you review the new code?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is the Travis CI build is failing? I noticed it with other pull requests too.

At the moment #3913 and #3917. If you stick around, though, I’m sure you’ll have the opportunity to see it start failing for other reasons; it happens now and then 🙂

if urlparse('s3://bucket/key?key=value').query != 'key=value':
from urlparse import uses_query
uses_query.append('s3')


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You missed a spot 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed I hope.

# Undo what Twisted's perspective broker adds to pickle register
# to prevent bugs like Twisted#7989 while serializing requests
import twisted.persisted.styles # NOQA
Expand Down