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] PY3: Implement some attributes of WrappedRequest required in Python 3 #1771

Merged
merged 1 commit into from Feb 8, 2016

Conversation

Projects
None yet
4 participants
@orangain
Contributor

orangain commented Feb 7, 2016

Purpose

Fix #1770, the failure to download the second or later requests to hosts using secure cookies. The problem is caused by missing type attribute of scrapy.http.WrappedRequest.

Though the official document seems to be outdated, request argument of CookieJar.add_cookie_header() requires some attributes instead of methods in Python 3. This is because urllib.request.Request's methods get_hosts(), get_type(), unverifiable() and get_origin_req_host() were deprecated in Python 3.3 and removed in Python 3.4.

See also:

Issue 15409: Deprecation Warning fix on cookiejar module - Python tracker
http://bugs.python.org/issue15409

cpython: ea8078365d3b
https://hg.python.org/cpython/rev/ea8078365d3b

Changes

  • Implement some attributes of scrapy.http.cookies.WrappedRequest required in Python 3.
  • Add unit tests.
@codecov-io

This comment has been minimized.

Show comment
Hide comment
@codecov-io

codecov-io Feb 7, 2016

Current coverage is 83.32%

Merging #1771 into master will increase coverage by +0.03% as of d62f3e4

Powered by Codecov. Updated on successful CI builds.

codecov-io commented Feb 7, 2016

Current coverage is 83.32%

Merging #1771 into master will increase coverage by +0.03% as of d62f3e4

Powered by Codecov. Updated on successful CI builds.

@kmike kmike changed the title from PY3: Implement some attributes of WrappedRequest required in Python 3 to [MRG+1] PY3: Implement some attributes of WrappedRequest required in Python 3 Feb 8, 2016

@kmike kmike added this to the v1.1 milestone Feb 8, 2016

@redapple redapple added the Python 3 label Feb 8, 2016

redapple added a commit that referenced this pull request Feb 8, 2016

Merge pull request #1771 from orangain/secure-cookies
[MRG+1] PY3: Implement some attributes of WrappedRequest required in Python 3

@redapple redapple merged commit c083935 into scrapy:master Feb 8, 2016

2 checks passed

codecov/patch 100.00% of diff hit (target 100.00%)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@redapple

This comment has been minimized.

Show comment
Hide comment
@redapple

redapple Feb 8, 2016

Contributor

Thanks @orangain !

Contributor

redapple commented Feb 8, 2016

Thanks @orangain !

@redapple

This comment has been minimized.

Show comment
Hide comment
@redapple

redapple Feb 8, 2016

Contributor

Needs backporting to 1.1 branch

Contributor

redapple commented Feb 8, 2016

Needs backporting to 1.1 branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment