Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPRQL update to work with Python 3.9.5 #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions sparql.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
Otherwise, the query is read from standard input.
"""

from base64 import encodestring
from base64 import encodebytes
from six.moves import input, map
from six.moves.urllib.parse import urlencode
from xml.dom import pulldom
Expand Down Expand Up @@ -417,8 +417,8 @@ def query(self, query, timeout=0, raw=False):

def authenticate(self, username, password):
# self._headers_map['Authorization'] = "Basic %s" % replace(
# encodestring("%s:%s" % (username, password)), "\012", "")
head = "Basic %s" % encodestring("%s:%s" % (username, password)).replace("\012", "")
# encodebytes("%s:%s" % (username, password)), "\012", "")
head = "Basic %s" % encodebytes("%s:%s" % (username, password)).replace("\012", "")
self._headers_map['Authorization'] = head


Expand Down Expand Up @@ -502,7 +502,7 @@ def _build_request(self, query):
separator = '&'
else:
separator = '?'
uri = self.endpoint.strip() + separator + query
uri = self.endpoint.strip() + str(separator) + str(query)
return ev_request.Request(uri)
else:
# uri = self.endpoint.strip().encode('ASCII')
Expand Down