Skip to content
This repository was archived by the owner on Mar 11, 2021. It is now read-only.
This repository was archived by the owner on Mar 11, 2021. It is now read-only.

Connection refused to python httplib socket #24

@parmegv

Description

@parmegv

tor-browser-crawler/tbcrawler/crawler.py:29: in crawl
self.__do_batch()
tor-browser-crawler/tbcrawler/crawler.py:47: in __do_batch
self.__do_instance()
tor-browser-crawler/tbcrawler/crawler.py:74: in __do_instance
self.driver.get_screenshot_as_file(self.job.png_file)
../../../anaconda2/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py:790: in get_screenshot_as_file
png = self.get_screenshot_as_png()
../../../anaconda2/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py:809: in get_screenshot_as_png
return base64.b64decode(self.get_screenshot_as_base64().encode('ascii'))
../../../anaconda2/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py:819: in get_screenshot_as_base64
return self.execute(Command.SCREENSHOT)['value']
../../../anaconda2/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py:231: in execute
response = self.command_executor.execute(driver_command, params)
../../../anaconda2/lib/python2.7/site-packages/selenium/webdriver/remote/remote_connection.py:395: in execute
return self._request(command_info[0], url, body=data)
../../../anaconda2/lib/python2.7/site-packages/selenium/webdriver/remote/remote_connection.py:425: in _request
self._conn.request(method, parsed_url.path, body, headers)
../../../anaconda2/lib/python2.7/httplib.py:1057: in request
self._send_request(method, url, body, headers)
../../../anaconda2/lib/python2.7/httplib.py:1097: in _send_request
self.endheaders(body)
../../../anaconda2/lib/python2.7/httplib.py:1053: in endheaders
self._send_output(message_body)
../../../anaconda2/lib/python2.7/httplib.py:897: in _send_output
self.send(msg)
../../../anaconda2/lib/python2.7/httplib.py:859: in send
self.connect()
../../../anaconda2/lib/python2.7/httplib.py:836: in connect
self.timeout, self.source_address)


address = ('127.0.0.1', '49630'), timeout = <object object at 0x7ff7c3150130>
source_address = None

def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT,
                      source_address=None):
    """Connect to *address* and return the socket object.

    Convenience function.  Connect to *address* (a 2-tuple ``(host,
    port)``) and return the socket object.  Passing the optional
    *timeout* parameter will set the timeout on the socket instance
    before attempting to connect.  If no *timeout* is supplied, the
    global default timeout setting returned by :func:`getdefaulttimeout`
    is used.  If *source_address* is set it must be a tuple of (host, port)
    for the socket to bind as a source address before making the connection.
    An host of '' or port 0 tells the OS to use the default.
    """

    host, port = address
    err = None
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
        af, socktype, proto, canonname, sa = res
        sock = None
        try:
            sock = socket(af, socktype, proto)
            if timeout is not _GLOBAL_DEFAULT_TIMEOUT:
                sock.settimeout(timeout)
            if source_address:
                sock.bind(source_address)
            sock.connect(sa)
            return sock

        except error as _:
            err = _
            if sock is not None:
                sock.close()

    if err is not None:
      raise err

E error: [Errno 111] Connection refused

../../../anaconda2/lib/python2.7/socket.py:575: error

This happened during a py.test execution, hence the format.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions