Skip to content

Concatenation between str and bytes no longer tolerated in Python 3.8.5+ #34

@Abdillah

Description

@Abdillah

This package no longer compatible with Python v3.8.5+ due to the stricter nature of string concatenation.

This PR might be the solution #33.

What happened?

The following error occured using the sample provided in the README.

>>> s.query("SELECT ?q WHERE { ?q ?p ?r } LIMIT 1")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/nix/store/ax9qn8myhf1d2zwa095b3zl2avm1ynwa-python3-3.8.9-env/lib/python3.8/site-packages/sparql.py", line 416, in query
    return q.query(query, timeout, raw=raw)
  File "/nix/store/ax9qn8myhf1d2zwa095b3zl2avm1ynwa-python3-3.8.9-env/lib/python3.8/site-packages/sparql.py", line 571, in query
    response = self._request(statement, timeout)
  File "/nix/store/ax9qn8myhf1d2zwa095b3zl2avm1ynwa-python3-3.8.9-env/lib/python3.8/site-packages/sparql.py", line 558, in _request
    response = self._build_response(query, opener, buf, timeout)
  File "/nix/store/ax9qn8myhf1d2zwa095b3zl2avm1ynwa-python3-3.8.9-env/lib/python3.8/site-packages/sparql.py", line 539, in _build_response
    request = self._build_request(query)
  File "/nix/store/ax9qn8myhf1d2zwa095b3zl2avm1ynwa-python3-3.8.9-env/lib/python3.8/site-packages/sparql.py", line 505, in _build_request
    uri = self.endpoint.strip() + separator + query
TypeError: can only concatenate str (not "bytes") to str

Expected

No error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions