Using solrpy 0.9.9, Python 3.7.1:
There is an issue with the text encoding for http authentication in this version.
When creating a solr object, e.g. solr.Solr(baseURL, http_user=httpuser, http_pass=httppass), core.py produces the following error at line 427 http_auth = 'Basic ' + http_auth.encode('base64').strip():
LookupError: 'base64' is not a text encoding; use codecs.encode() to handle arbitrary codecs
http_user and http_pass are str type
I don't get this error using Python 2.7
I got it to work by importing the base64 module and changing line 427 to:
http_auth = b'Basic ' + base64.b64encode(http_auth.encode()).strip()
Using solrpy 0.9.9, Python 3.7.1:
There is an issue with the text encoding for http authentication in this version.
When creating a solr object, e.g.
solr.Solr(baseURL, http_user=httpuser, http_pass=httppass), core.py produces the following error at line 427http_auth = 'Basic ' + http_auth.encode('base64').strip():LookupError: 'base64' is not a text encoding; use codecs.encode() to handle arbitrary codecshttp_user and http_pass are str type
I don't get this error using Python 2.7
I got it to work by importing the base64 module and changing line 427 to:
http_auth = b'Basic ' + base64.b64encode(http_auth.encode()).strip()