Open odkken opened 8 years ago
Here is the relevant traceback
HTTPError Traceback (most recent call last)
/usr/local/var/pyenv/versions/2.7.12/lib/python2.7/site-packages/okcupyd/tasks/__init__.pyc in <module>(
)
----> 1 u.search()
/usr/local/var/pyenv/versions/2.7.12/lib/python2.7/site-packages/okcupyd/user.pyc in search(self, **kwar
gs)
160 count = kwargs.pop('count')
161 return search(session=self._session, count=count, **kwargs)
--> 162 return SearchFetchable(self._session, **kwargs)
163
164 def delete_threads(self, thread_ids_or_threads):
/usr/local/var/pyenv/versions/2.7.12/lib/python2.7/site-packages/okcupyd/json_search.pyc in SearchFetcha
ble(session, **kwargs)
35 return util.Fetchable(
36 SearchManager(
---> 37 SearchJSONFetcher(session, **kwargs),
38 ProfileBuilder(session)
39 )
/usr/local/var/pyenv/versions/2.7.12/lib/python2.7/site-packages/okcupyd/json_search.pyc in __init__(sel
f, session, **options)
82 self._session = session or Session.login()
83 self._options = options
---> 84 self._parameters = search_filters.build(session=self._session, **options)
85
86 def _get_headers(self):
/usr/local/var/pyenv/versions/2.7.12/lib/python2.7/site-packages/okcupyd/filter.pyc in build(self, **kwa
rgs)
153 return {
154 builder.output_key: builder.transform_from_kwargs(kwargs)
--> 155 for builder in self.builders
156 if builder.decide(kwargs)
157 }
/usr/local/var/pyenv/versions/2.7.12/lib/python2.7/site-packages/okcupyd/filter.pyc in <dictcomp>((build
er,))
154 builder.output_key: builder.transform_from_kwargs(kwargs)
155 for builder in self.builders
--> 156 if builder.decide(kwargs)
157 }
158
/usr/local/var/pyenv/versions/2.7.12/lib/python2.7/site-packages/okcupyd/filter.pyc in transform_from_kw
args(cls, kwargs)
48
49 def transform_from_kwargs(cls, kwargs):
---> 50 return cls.transform(*[kwargs.get(key) for key in cls.keys])
51
52 def _set_defaults(cls):
/usr/local/var/pyenv/versions/2.7.12/lib/python2.7/site-packages/okcupyd/json_search.pyc in transform(lo
cation, location_cache)
213 # injection. A better solution is probably needed long term
214 def transform(location, location_cache):
--> 215 return location_cache.get_locid(location)
216
217
/usr/local/var/pyenv/versions/2.7.12/lib/python2.7/site-packages/okcupyd/location.pyc in get_locid(self,
query)
16 if query in self._query_cache:
17 return self._query_cache[query]
---> 18 result = self._query(query)
19 if 'results' in result and len(result['results']):
20 locid = result['results'][0]['locid']
/usr/local/var/pyenv/versions/2.7.12/lib/python2.7/site-packages/okcupyd/location.pyc in _query(self, qu
ery)
32 return self._session.okc_get(
33 'apitun/location/query',
---> 34 params={'q': query, 'access_token': self._session.access_token},
35 ).json()
/usr/local/var/pyenv/versions/2.7.12/lib/python2.7/site-packages/okcupyd/session.pyc in okc_method(self,
path, secure, **kwargs)
132 self.rate_limiter.wait()
133 response = base_method(self.build_path(path, secure), **kwargs)
--> 134 response.raise_for_status()
135 return response
136 return okc_method
/usr/local/var/pyenv/versions/2.7.12/lib/python2.7/site-packages/requests/models.pyc in raise_for_statu(
self)
849
850 if http_error_msg:
--> 851 raise HTTPError(http_error_msg, response=self)
852
853 def close(self):
HTTPError: 404 Client Error:
The request that is failing is actually the request to get the location ID. It seems that this endpoint has been expired.
def transform(location, location_cache):
return location_cache.get_locid(location)
We need to figure out if this just been completely eliminated or changed in some way.
This should be fixed now. Can you confirm @odkken .
Did a fresh clone and am actually seeing issue #79 again now. I think I had commented out the imports before, but since I see it's been reported I figured I'd bring it up.
Also, I'm having trouble installing the requirements (looks like it has to do with the ~= version specification?) using pycharm's auto install feature. I think it was trying to use anaconda on windows, and on linux it's using pip/setuptools (none of which succeed).
@odkken you shouldn't be getting #79 on the latest version since the line that was causing it is gone from the repository.
Here's the stack trace I get when running the search:
Traceback (most recent call last):
File "/root/okc2.7/local/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 2869, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "
Just cloned this today, on master.
its probably importing it from the wrong place. or maybe getting the tasks list from the wrong place, or perhaps you have an old version of invoke.
Don't clone okcupyd like that
you should install it with the command mentioned in the README (unless your plan on actually developing it yourself).
Seems logging in now returns a status_str: 'Sorry, Staff Robot had a meltdown—check back later' (not sure if this matters, login still seems to technically work)
On performing a search (from the example search.py), a 404 error is always returned.