Skip to content

Fix another unicode error on Python 3

This fixes the following Unicode error in Python 3:

$ python -c 'from ligo.gracedb import rest; rest.GraceDb().get("https://gracedb.invalid/")'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/lpsinger/local/lib/python3.6/site-packages/ligo/gracedb/rest.py", line 369, in get
    return self.request("GET", url, headers=headers)
  File "/Users/lpsinger/local/lib/python3.6/site-packages/ligo/gracedb/rest.py", line 520, in request
    return GsiRest.request(self, method, *args, **kwargs)
  File "/Users/lpsinger/local/lib/python3.6/site-packages/ligo/gracedb/rest.py", line 351, in request
    return self.adjustResponse(response)
  File "/Users/lpsinger/local/lib/python3.6/site-packages/ligo/gracedb/rest.py", line 364, in adjustResponse
    raise HTTPError(response.status, response.reason, response_content)
  File "/Users/lpsinger/local/lib/python3.6/site-packages/ligo/gracedb/rest.py", line 157, in __init__
    Exception.__init__(self, (status, reason+" / "+message))
TypeError: must be str, not bytes

Merge request reports

Loading