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

Invalid syntax #3

Closed
lajlev opened this issue May 12, 2018 · 4 comments
Closed

Invalid syntax #3

lajlev opened this issue May 12, 2018 · 4 comments

Comments

@lajlev
Copy link

lajlev commented May 12, 2018

I get invalid syntax when I run python download_and_index.py --apikey MYADMINKEY

sceenshot

@EmilStenstrom
Copy link
Owner

@lajlev This is because you are using an earlier version than Python 3.6. Could you try installing 3.6 and see if things work then?

@lajlev
Copy link
Author

lajlev commented May 12, 2018

Worked, but I bumped into another error message

python3 download_and_index.py --apikey 272f23a5be622454da4f18bc6b7a5d6d
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 601, in urlopen
    chunked=chunked)
  File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 387, in _make_request
    six.raise_from(e, None)
  File "<string>", line 2, in raise_from
  File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 383, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1331, in getresponse
    response.begin()
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 297, in begin
    version, status, reason = self._read_status()
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 266, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/requests/adapters.py", line 440, in send
    timeout=timeout
  File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 639, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/local/lib/python3.6/site-packages/urllib3/util/retry.py", line 357, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/usr/local/lib/python3.6/site-packages/urllib3/packages/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 601, in urlopen
    chunked=chunked)
  File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 387, in _make_request
    six.raise_from(e, None)
  File "<string>", line 2, in raise_from
  File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 383, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1331, in getresponse
    response.begin()
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 297, in begin
    version, status, reason = self._read_status()
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 266, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/boardgamegeek/utils.py", line 309, in request_and_parse_xml
    r = requests_session.get(url, params=params, timeout=timeout)
  File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 521, in get
    return self.request('GET', url, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/requests_cache/core.py", line 126, in request
    **kwargs
  File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.6/site-packages/requests_cache/core.py", line 99, in send
    return send_request_and_cache_response()
  File "/usr/local/lib/python3.6/site-packages/requests_cache/core.py", line 91, in send_request_and_cache_response
    response = super(CachedSession, self).send(request, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/boardgamegeek/utils.py", line 84, in send
    return super(RateLimitingAdapter, self).send(request, **kw)
  File "/usr/local/lib/python3.6/site-packages/requests/adapters.py", line 490, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "download_and_index.py", line 161, in <module>
    main(api_key_admin=args.apikey)
  File "download_and_index.py", line 139, in main
    user_name=SETTINGS["boardgamegeek"]["user_name"]
  File "download_and_index.py", line 28, in collection
    **SETTINGS["boardgamegeek"]["extra_params"]
  File "/usr/local/lib/python3.6/site-packages/boardgamegeek/api.py", line 646, in collection
    retry_delay=self._retry_delay)
  File "/usr/local/lib/python3.6/site-packages/boardgamegeek/utils.py", line 367, in request_and_parse_xml
    raise BGGApiError("error fetching BGG API response: {}".format(e))
boardgamegeek.exceptions.BGGApiError: error fetching BGG API response: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))

@EmilStenstrom
Copy link
Owner

Progress! :)

That second error means that BGGs API didn’t work just when you made the request. Seems the API is somewhat shaky... Does it work if you try again?

@lajlev
Copy link
Author

lajlev commented May 13, 2018

Worked 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants