lugensa / scorched

Sunburnt offspring solr client
MIT License
27 stars 19 forks source link

Scorched 0.12.0 no longer compatible with httlib2 caching #53

Closed ldaverio closed 7 years ago

ldaverio commented 7 years ago

Hello, I've just come across a problem which arose after upgrading scorched from 0.11.0 to 0.12.0, in relation with the use of caching in the httplib2 module. The following code:

from scorched import SolrInterface from httplib2 import Http si = SolrInterface(url='http://localhost:8983/solr/XXX', http_connection=Http('/tmp'))

works with scorched <= 0.11.0, but produces the following error with 0.12.0:

File "/Users/daverio/pydev/lib/python3.5/site-packages/scorched/connection.py", line 292, in __init self.schema = self.init_schema() File "/Users/daverio/pydev/lib/python3.5/site-packages/scorched/connection.py", line 298, in init_schema self.remote_schema_file)) File "/Users/daverio/pydev/lib/python3.5/site-packages/scorched/connection.py", line 73, in request return self.httpconnection.request(*args, **kwargs) File "/Users/daverio/pydev/lib/python3.5/site-packages/httplib2/\_init.py", line 1176, in request (scheme, authority, request_uri, defraguri) = urlnorm(uri) File "/Users/daverio/pydev/lib/python3.5/site-packages/httplib2/\_init__.py", line 148, in urlnorm raise RelativeURIError("Only absolute URIs are allowed. uri = %s" % uri) httplib2.RelativeURIError: Only absolute URIs are allowed. uri = GET

I haven't taken the time to investigate the problem yet. I'm not sure if I should continue using httplib2 caching.

delijati commented 7 years ago

Hi @ldaverio, the version <= 0.12.0. never really used http_connection . You could try https://github.com/ionrock/cachecontrol as we use requests for connection handling.

delijati commented 7 years ago

Seems tom bei solved !?