Closed BelKed closed 1 year ago
Thanks for your report. When reviewing the latest pull request, I stumbled upon some issue when updating the test cases which seems to be related to this. At the moment some tests for the search functionality are either out-of-date or marked as expected failures.
I did not have yet have enough time for looking into this. Feel free to have a deeper look at this to get it back working as expected.
I have exactly the same issue when I try the example from the docs:
point = Point(56.25263, 15.26738)
for cache in geocaching.search(point, limit=50):
if cache.type == Type.traditional:
print(cache.name)
Changing the limit (even to 1) does not make any difference.
I am not sure if we are able to do anything about this as already mentioned in my last comment. We might be able to catch this in https://github.com/tomasbedrich/pycaching/blob/master/pycaching/geocaching.py#L94 and report "Cannot load page" instead, but this would not be really helpful either. If you want to dig into this to find a solution, feel free to do so.
This might be fixed by #175 as well, but this is still work in progress without recent changes.
I get the same issue except the error message is Remote end closed connection without response
I get the same issue except the error message is
Remote end closed connection without response
@TrollBlox Same here on version 4.2.3 with Python 3.10.7 on Windows 10
Traceback (most recent call last):
File "C:\Users\raine\Documents\GitHub\geo-app\backend\venv\lib\site-packages\urllib3\connectionpool.py", line 703, in urlopen
httplib_response = self._make_request(
File "C:\Users\raine\Documents\GitHub\geo-app\backend\venv\lib\site-packages\urllib3\connectionpool.py", line 449, in _make_request
six.raise_from(e, None)
File "<string>", line 3, in raise_from
File "C:\Users\raine\Documents\GitHub\geo-app\backend\venv\lib\site-packages\urllib3\connectionpool.py", line 444, in _make_request
httplib_response = conn.getresponse()
File "C:\Python310\lib\http\client.py", line 1374, in getresponse
response.begin()
File "C:\Python310\lib\http\client.py", line 318, in begin
version, status, reason = self._read_status()
File "C:\Python310\lib\http\client.py", line 287, 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 "C:\Users\raine\Documents\GitHub\geo-app\backend\venv\lib\site-packages\requests\adapters.py", line 489, in send
resp = conn.urlopen(
File "C:\Users\raine\Documents\GitHub\geo-app\backend\venv\lib\site-packages\urllib3\connectionpool.py", line 787, in urlopen
retries = retries.increment(
File "C:\Users\raine\Documents\GitHub\geo-app\backend\venv\lib\site-packages\urllib3\util\retry.py", line 550, in increment
raise six.reraise(type(error), error, _stacktrace)
File "C:\Users\raine\Documents\GitHub\geo-app\backend\venv\lib\site-packages\urllib3\packages\six.py", line 769, in reraise
raise value.with_traceback(tb)
File "C:\Users\raine\Documents\GitHub\geo-app\backend\venv\lib\site-packages\urllib3\connectionpool.py", line 703, in urlopen
httplib_response = self._make_request(
File "C:\Users\raine\Documents\GitHub\geo-app\backend\venv\lib\site-packages\urllib3\connectionpool.py", line 449, in _make_request
six.raise_from(e, None)
File "<string>", line 3, in raise_from
File "C:\Users\raine\Documents\GitHub\geo-app\backend\venv\lib\site-packages\urllib3\connectionpool.py", line 444, in _make_request
httplib_response = conn.getresponse()
File "C:\Python310\lib\http\client.py", line 1374, in getresponse
response.begin()
File "C:\Python310\lib\http\client.py", line 318, in begin
version, status, reason = self._read_status()
File "C:\Python310\lib\http\client.py", line 287, 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 "C:\Users\raine\Documents\GitHub\geo-app\backend\venv\lib\site-packages\pycaching\geocaching.py", line 82, in _request
res = self._session.request(method, url, **kwargs)
File "C:\Users\raine\Documents\GitHub\geo-app\backend\venv\lib\site-packages\requests\sessions.py", line 587, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\raine\Documents\GitHub\geo-app\backend\venv\lib\site-packages\requests\sessions.py", line 723, in send
history = [resp for resp in gen]
File "C:\Users\raine\Documents\GitHub\geo-app\backend\venv\lib\site-packages\requests\sessions.py", line 723, in <listcomp>
history = [resp for resp in gen]
File "C:\Users\raine\Documents\GitHub\geo-app\backend\venv\lib\site-packages\requests\sessions.py", line 266, in resolve_redirects
resp = self.send(
File "C:\Users\raine\Documents\GitHub\geo-app\backend\venv\lib\site-packages\requests\sessions.py", line 701, in send
r = adapter.send(request, **kwargs)
File "C:\Users\raine\Documents\GitHub\geo-app\backend\venv\lib\site-packages\requests\adapters.py", line 547, 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 "C:\Users\raine\Documents\GitHub\geo-app\backend\adhoc.py", line 25, in <module>
for cache in geocaching.search(point, limit=1):
File "C:\Users\raine\Documents\GitHub\geo-app\backend\venv\lib\site-packages\pycaching\geocaching.py", line 257, in search
geocaches_table, whole_page = self._search_get_page(point, start_index)
File "C:\Users\raine\Documents\GitHub\geo-app\backend\venv\lib\site-packages\pycaching\geocaching.py", line 326, in _search_get_page
res = self._request(
File "C:\Users\raine\Documents\GitHub\geo-app\backend\venv\lib\site-packages\pycaching\geocaching.py", line 94, in _request
if e.response.status_code == 429: # Handle rate limiting errors
AttributeError: 'NoneType' object has no attribute 'status_code'
I somehow forgot to mention this issue in https://github.com/tomasbedrich/pycaching/pull/206, where it was also fixed...
When trying to load caches in some location using
Geocaching.search()
, it doesn't work because of error (Remote end closed connection without response
). However, loading a single geocache usingGeocaching.get_cache()
seems to work fine...12.6.1
3.9.2
pycaching
version:4.2.3
Python code with error:
Error:
Edit: Updated the traceback.