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

vcrpy 1.11.1 doesn't work with requests 2.13 - fails silently #341

Closed
farialima opened this issue Dec 10, 2017 · 3 comments
Closed

vcrpy 1.11.1 doesn't work with requests 2.13 - fails silently #341

farialima opened this issue Dec 10, 2017 · 3 comments
Labels
stale Issues and PRs that have had birthdays since last activity. Please feel free to reopen though!

Comments

@farialima
Copy link

farialima commented Dec 10, 2017

... but it works with requests 2.18.4 (I haven't tried intermediate versions)

vcrpy 1.11, however, works with requests 2.13.

See below for a log that show the cases that work and don't work.
test case:

import vcr
import urllib2
import requests
import logging

logging.basicConfig()
vcr_log = logging.getLogger("vcr")
vcr_log.setLevel(logging.DEBUG)

with vcr.use_cassette('fixtures/urllib2.yaml'):
    response = urllib2.urlopen('http://www.iana.org/domains/reserved').read()
    assert 'Example domains' in response


with vcr.use_cassette('fixtures/requests.yaml'):
    response = requests.get('http://www.iana.org/domains/reserved').text
    assert 'Example domains' in response

Output:

(venv) bash-3.2$ pip install vcrpy==1.11.1
Collecting vcrpy==1.11.1
  Using cached vcrpy-1.11.1-py2.py3-none-any.whl
Requirement already satisfied: PyYAML in ./venv/lib/python2.7/site-packages (from vcrpy==1.11.1)
Requirement already satisfied: mock; python_version in "2.7, 3.1, 3.2" in ./venv/lib/python2.7/site-packages (from vcrpy==1.11.1)
Requirement already satisfied: contextlib2; python_version in "2.7, 3.1, 3.2" in ./venv/lib/python2.7/site-packages (from vcrpy==1.11.1)
Requirement already satisfied: wrapt in ./venv/lib/python2.7/site-packages (from vcrpy==1.11.1)
Requirement already satisfied: six>=1.5 in ./venv/lib/python2.7/site-packages (from vcrpy==1.11.1)
Requirement already satisfied: funcsigs>=1; python_version < "3.3" in ./venv/lib/python2.7/site-packages (from mock; python_version in "2.7, 3.1, 3.2"->vcrpy==1.11.1)
Requirement already satisfied: pbr>=0.11 in ./venv/lib/python2.7/site-packages (from mock; python_version in "2.7, 3.1, 3.2"->vcrpy==1.11.1)
Installing collected packages: vcrpy
Successfully installed vcrpy-1.11.1
(venv) bash-3.2$ pip install requests==2.18.4
Collecting requests==2.18.4
  Downloading requests-2.18.4-py2.py3-none-any.whl (88kB)
    100% |████████████████████████████████| 92kB 2.7MB/s
Collecting urllib3<1.23,>=1.21.1 (from requests==2.18.4)
  Downloading urllib3-1.22-py2.py3-none-any.whl (132kB)
    100% |████████████████████████████████| 133kB 3.8MB/s
Requirement already satisfied: idna<2.7,>=2.5 in ./venv/lib/python2.7/site-packages (from requests==2.18.4)
Collecting chardet<3.1.0,>=3.0.2 (from requests==2.18.4)
  Downloading chardet-3.0.4-py2.py3-none-any.whl (133kB)
    100% |████████████████████████████████| 143kB 1.4MB/s
Collecting certifi>=2017.4.17 (from requests==2.18.4)
  Using cached certifi-2017.11.5-py2.py3-none-any.whl
Installing collected packages: urllib3, chardet, certifi, requests
  Found existing installation: urllib3 1.12
    Uninstalling urllib3-1.12:
      Successfully uninstalled urllib3-1.12
  Found existing installation: certifi 2015.11.20.1
    Uninstalling certifi-2015.11.20.1:
      Successfully uninstalled certifi-2015.11.20.1
  Found existing installation: requests 2.13.0
    Uninstalling requests-2.13.0:
      Successfully uninstalled requests-2.13.0
Successfully installed certifi-2017.11.5 chardet-3.0.4 requests-2.18.4 urllib3-1.22
(venv) bash-3.2$ python test.py
DEBUG:vcr.cassette:Entering context for cassette at fixtures/urllib2.yaml.
DEBUG:vcr.stubs:Got <Request (GET) http://www.iana.org/domains/reserved>
INFO:vcr.stubs:Playing response for <Request (GET) http://www.iana.org/domains/reserved> from cassette
DEBUG:vcr.cassette:Exiting context for cassette at fixtures/urllib2.yaml.
DEBUG:vcr.cassette:Entering context for cassette at fixtures/requests.yaml.
DEBUG:vcr.stubs:Got <Request (GET) http://www.iana.org/domains/reserved>
INFO:vcr.stubs:Playing response for <Request (GET) http://www.iana.org/domains/reserved> from cassette
DEBUG:vcr.cassette:Exiting context for cassette at fixtures/requests.yaml.
(venv) bash-3.2$ pip install requests==2.13.0
Collecting requests==2.13.0
  Using cached requests-2.13.0-py2.py3-none-any.whl
Installing collected packages: requests
  Found existing installation: requests 2.18.4
    Uninstalling requests-2.18.4:
      Successfully uninstalled requests-2.18.4
Successfully installed requests-2.13.0
(venv) bash-3.2$ python test.py
DEBUG:vcr.cassette:Entering context for cassette at fixtures/urllib2.yaml.
DEBUG:vcr.stubs:Got <Request (GET) http://www.iana.org/domains/reserved>
INFO:vcr.stubs:Playing response for <Request (GET) http://www.iana.org/domains/reserved> from cassette
DEBUG:vcr.cassette:Exiting context for cassette at fixtures/urllib2.yaml.
DEBUG:vcr.cassette:Entering context for cassette at fixtures/requests.yaml.
DEBUG:vcr.cassette:Exiting context for cassette at fixtures/requests.yaml.
(venv) bash-3.2$ pip install vcrpy==1.11
Collecting vcrpy==1.11
  Using cached vcrpy-1.11.0-py2.py3-none-any.whl
Requirement already satisfied: PyYAML in ./venv/lib/python2.7/site-packages (from vcrpy==1.11)
Requirement already satisfied: mock; python_version in "2.7, 3.1, 3.2" in ./venv/lib/python2.7/site-packages (from vcrpy==1.11)
Requirement already satisfied: contextlib2; python_version in "2.7, 3.1, 3.2" in ./venv/lib/python2.7/site-packages (from vcrpy==1.11)
Requirement already satisfied: wrapt in ./venv/lib/python2.7/site-packages (from vcrpy==1.11)
Requirement already satisfied: six>=1.5 in ./venv/lib/python2.7/site-packages (from vcrpy==1.11)
Requirement already satisfied: funcsigs>=1; python_version < "3.3" in ./venv/lib/python2.7/site-packages (from mock; python_version in "2.7, 3.1, 3.2"->vcrpy==1.11)
Requirement already satisfied: pbr>=0.11 in ./venv/lib/python2.7/site-packages (from mock; python_version in "2.7, 3.1, 3.2"->vcrpy==1.11)
Installing collected packages: vcrpy
  Found existing installation: vcrpy 1.11.1
    Uninstalling vcrpy-1.11.1:
      Successfully uninstalled vcrpy-1.11.1
Successfully installed vcrpy-1.11.0
(venv) bash-3.2$ python test.py
DEBUG:vcr.cassette:Entering context for cassette at fixtures/urllib2.yaml.
DEBUG:vcr.stubs:Got <Request (GET) http://www.iana.org/domains/reserved>
INFO:vcr.stubs:Playing response for <Request (GET) http://www.iana.org/domains/reserved> from cassette
DEBUG:vcr.cassette:Exiting context for cassette at fixtures/urllib2.yaml.
DEBUG:vcr.cassette:Entering context for cassette at fixtures/requests.yaml.
DEBUG:vcr.stubs:Got <Request (GET) http://www.iana.org/domains/reserved>
INFO:vcr.stubs:Playing response for <Request (GET) http://www.iana.org/domains/reserved> from cassette
DEBUG:vcr.cassette:Exiting context for cassette at fixtures/requests.yaml.
(venv) bash-3.2$
@neozenith neozenith added the stale Issues and PRs that have had birthdays since last activity. Please feel free to reopen though! label Jan 5, 2020
@graingert
Copy link
Collaborator

@neozenith I noticed you bulk closed a lot of issues right now. It might be worth adding a note to each of them explaining why, eg:

"This issue has had no activity in x days etc etc..."

@neozenith
Copy link
Collaborator

There are a few that I'm leaving open for a week and have commented on those.
I'm about to do the rounds of commenting on the bulk closed ones.

Labelled them as stale to make it easier to work through commenting on them all.

@neozenith
Copy link
Collaborator

A lot of changes have happened to VCRpy since this ticket was opened. As this ticket has become stale and we have a lot of old tickets that need to be groomed, I'm closing this for now to make it easier to see what is still relevant.

However if it is still needed, please feel free to re-open or create a new ticket.

Thanks! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Issues and PRs that have had birthdays since last activity. Please feel free to reopen though!
Projects
None yet
Development

No branches or pull requests

3 participants