-
Notifications
You must be signed in to change notification settings - Fork 235
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
getaddrinfo failed #26
Comments
OS, Python version, |
Windows; Python 3.6; krakenex version '0.1.4' ! |
Never tested using on Windows, so could be Windows-specific. (EDIT: Got no resources to verify.) Please post the full stack trace. NB: Probably another reason to hand this off to |
import http.client
import urllib.request
import urllib.parse
class Connection:
"""Kraken.com connection handler.
Public methods:
close
"""
def __init__(self, uri = 'api.kraken.com', timeout = 30):
""" Create an object for reusable connections.
Arguments:
uri -- URI to connect to (default: 'https://api.kraken.com')
timeout -- blocking operations' timeout in seconds (default: 30)
"""
self.headers = {
'User-Agent': 'krakenex/0.0.3 (+https://github.com/veox/krakenex)'
}
self.conn = http.client.HTTPSConnection(uri, timeout = timeout)
print('conn : ' , self.conn )
def close(self):
""" Close the connection.
No arguments.
"""
self.conn.close()
def _request(self, url, req = {}, headers = {}):
""" Send POST request to API server.
url -- Fully-qualified URL with all necessary urlencoded
information (string, no default)
req -- additional API request parameters (default: {})
headers -- additional HTTPS headers, such as API-Key and API-Sign
(default: {})
"""
data = urllib.parse.urlencode(req)
print(data)
headers.update(self.headers)
self.conn.request("POST", url, data, headers)
response = self.conn.getresponse()
return response.read()
print(Connection()._request( 'https://api.kraken.com/0/public/Depth' , req = {}, headers = {})) |
Please use three backticks for multi-line code inserts. (I've edited your post, and #28.) What I asked for was the error message, from The above looks like a part of the |
Hi,
When I run Depth.py I have this issue :
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
gaierror: [Errno 11004] getaddrinfo failed
I don't understand why....
The text was updated successfully, but these errors were encountered: