From 4cb8c6ea3fbd4f64b78dd300aa637e0de05aeb45 Mon Sep 17 00:00:00 2001 From: jiho Date: Wed, 13 May 2020 15:31:23 +0900 Subject: [PATCH] Fixed basic authentication to work properly in Python3 --- setup.py | 5 +++-- solr/core.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 3463c30..2b47af4 100644 --- a/setup.py +++ b/setup.py @@ -10,18 +10,19 @@ with open('README.md') as f: long_description = f.read() -__version__ = '0.9.9' +__version__ = '1.0.0' setup( name='solrpy', # We can do this because we don't rely on getting "built" to be importable: version=__version__, # update only solr.core.__version__ - url='http://code.google.com/p/solrpy', + url='http://github.com/search5/solrpy', license='http://opensource.org/licenses/apache2.0.php', packages=find_packages(), long_description=long_description, long_description_content_type='text/markdown', # This is important! install_requires=["future", "six", "pyyaml"], + python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4', description='Client for the Solr search service', tests_require=["future", "six", "nose>=0.10.1"], test_suite='nose.collector' diff --git a/solr/core.py b/solr/core.py index 0d117dc..1354206 100644 --- a/solr/core.py +++ b/solr/core.py @@ -429,7 +429,7 @@ def __init__(self, url, http_auth = http_user + ':' + http_pass if six.PY3: http_auth = http_auth.strip().encode('utf-8') - http_auth = 'Basic ' + base64.b64encode(http_auth) + http_auth = b'Basic ' + base64.b64encode(http_auth) self.auth_headers = {'Authorization': http_auth} else: self.auth_headers = {}