question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

fails when working through proxy (as instructed by http_proxy env var): invalid literal for int() with base 10: '3128http'

See original GitHub issue

as of 1.6.1 (as in Debian)

$> echo $http_proxy
http://localhost:3128

$> venv-tests/bin/nosetests -s -v datalad/crawler/nodes/tests/test_misc.py
datalad.crawler.nodes.tests.test_misc.test_get_deposition_filename ... ok
datalad.crawler.nodes.tests.test_misc.test_assign ... SKIP: TODO
datalad.crawler.nodes.tests.test_misc.test_rename ... SKIP: TODO

----------------------------------------------------------------------
Ran 3 tests in 14.059s

OK (SKIP=2)

$> venv-tests/bin/nosetests -s -v datalad/crawler/nodes/tests/test_misc.py
datalad.crawler.nodes.tests.test_misc.test_get_deposition_filename ... ERROR
datalad.crawler.nodes.tests.test_misc.test_assign ... SKIP: TODO
datalad.crawler.nodes.tests.test_misc.test_rename ... SKIP: TODO

======================================================================
ERROR: datalad.crawler.nodes.tests.test_misc.test_get_deposition_filename
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/yoh/proj/datalad/datalad/venv-tests/local/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/usr/lib/python2.7/dist-packages/vcr/cassette.py", line 95, in __call__
    return function(*args, **kwargs)
  File "/home/yoh/proj/datalad/datalad/datalad/crawler/nodes/tests/test_misc.py", line 22, in test_get_deposition_filename
    output = list(get_deposition_filename(**input))
  File "/home/yoh/proj/datalad/datalad/datalad/crawler/nodes/misc.py", line 85, in get_deposition_filename
    yield updated(data, {'filename': get_url_deposition_filename(data['url'])})
  File "/home/yoh/proj/datalad/datalad/datalad/support/network.py", line 46, in get_url_deposition_filename
    r = retry_urlopen(request)
  File "/home/yoh/proj/datalad/datalad/datalad/support/network.py", line 113, in retry_urlopen
    return urlopen(url)
  File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 431, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 449, in _open
    '_open', req)
  File "/usr/lib/python2.7/urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 1227, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/usr/lib/python2.7/urllib2.py", line 1200, in do_open
    r = h.getresponse(buffering=True)
  File "/usr/lib/python2.7/dist-packages/vcr/stubs/__init__.py", line 220, in getresponse
    if self.cassette.can_play_response_for(self._vcr_request):
  File "/usr/lib/python2.7/dist-packages/vcr/cassette.py", line 199, in can_play_response_for
    return request and request in self and \
  File "/usr/lib/python2.7/dist-packages/vcr/cassette.py", line 270, in __contains__
    for index, response in self._responses(request):
  File "/usr/lib/python2.7/dist-packages/vcr/cassette.py", line 194, in _responses
    if requests_match(request, stored_request, self._match_on):
  File "/usr/lib/python2.7/dist-packages/vcr/matchers.py", line 89, in requests_match
    matches = [(m(r1, r2), m) for m in matchers]
  File "/usr/lib/python2.7/dist-packages/vcr/matchers.py", line 25, in port
    return r1.port == r2.port
  File "/usr/lib/python2.7/dist-packages/vcr/request.py", line 67, in port
    port = parse_uri.port
  File "/usr/lib/python2.7/urlparse.py", line 113, in port
    port = int(port, 10)
ValueError: invalid literal for int() with base 10: '3128http'
(Pdb) up
> /usr/lib/python2.7/dist-packages/vcr/request.py(67)port()
-> port = parse_uri.port
(Pdb) up
> /usr/lib/python2.7/dist-packages/vcr/matchers.py(25)port()
-> return r1.port == r2.port
(Pdb) up
> /usr/lib/python2.7/dist-packages/vcr/matchers.py(89)requests_match()
-> matches = [(m(r1, r2), m) for m in matchers]
(Pdb) p r2
<Request (GET) http://localhost:3128http://human.brain-map.org/api/v2/well_known_file_download/157722290>

Issue Analytics

  • State:open
  • Created 8 years ago
  • Comments:31 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
agriffiscommented, Oct 8, 2016

Ehhh not to excited about adding some kind of pysocks dependency to run tests

Why is that? IMHO dependencies for devel/tests are totally fine. I only worry about adding deps when it affects install. In particular, I’d rather add dev deps to keep things self-contained than depend on an external server.

0reactions
neozenithcommented, Feb 15, 2020

Hi, I just wanted to update active PRs and issues to let you know I will no longer be an active maintainer on this project.

I recently changed jobs where I no longer use VCRpy or Python at all so I don’t have the bandwidth anymore. I won’t be monitoring issues or PRs either.

I will have to delegate to other maintainers or ask for some contributors to step up.

I know the Azure CLI uses VCRpy so it would be nice if they could spare some sprint time to maintain this project as it was invaluable in our CI when I was using it.

Kind regards, Josh

Read more comments on GitHub >

github_iconTop Results From Across the Web

ValueError: invalid literal for int () with base 10 - Stack Overflow
Answer: Your traceback is telling you that int() takes integers, you are trying to give a decimal, so you need to use float()...
Read more >
Using an HTTP proxy - AWS Command Line Interface
To access AWS through proxy servers, you can configure the HTTP_PROXY and HTTPS_PROXY environment variables with either the DNS domain names or IP...
Read more >
Building and serving Angular apps
When you define an environment variable http_proxy or HTTP_PROXY , an agent is automatically added to pass calls through your corporate proxy when...
Read more >
How to Set Up Squid Proxy for Private Connections on Ubuntu ...
In this tutorial, you will be installing and configuring Squid to provide an HTTP proxy on a Ubuntu 20.04 server.
Read more >
Proxy Auto-Configuration (PAC) file - HTTP - MDN Web Docs
Predefined functions and environment. These functions can be used in building the PAC file: Hostname based conditions. isPlainHostName() ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found