1. 13 Sep, 2018 1 commit
  2. 31 Jul, 2018 2 commits
    • Leo Pound Singer's avatar
      Make HTTPError pickleable · dd107fa3
      Leo Pound Singer authored
      According to the [Celery manual]:
      
      > A rarely known Python fact is that exceptions must conform to
      > some simple rules to support being serialized by the pickle
      > module.
      >
      > Tasks that raise exceptions that aren’t pickleable won’t work
      > properly when Pickle is used as the serializer.
      >
      > To make sure that your exceptions are pickleable the exception
      > MUST provide the original arguments it was instantiated with in
      > its .args attribute. The simplest way to ensure this is to have
      > the exception call Exception.__init__.
      
      The class `ligo.gracedb.exceptions.HTTPError` does not follow
      these rules, so it is not pickleable. Here is a demonstration of
      that:
      
          >>> import pickle
          >>> from ligo.gracedb.exceptions import HTTPError
          >>> pickle.loads(pickle.dumps(HTTPError(404, 'foo', 'bar')))
          Traceback (most recent call last):
            File "<stdin>", line 1, in <module>
          TypeError: __init__() missing 2 required positional arguments:
          'reason' and 'message'
      
      This patch makes `HTTPError` pickleable so that it can be properly
      represented in Celery task stack traces.
      
      [Celery manual]: http://docs.celeryproject.org/en/latest/userguide/tasks.html#creating-pickleable-exceptions
      dd107fa3
    • Duncan Macleod's avatar
      setup.py: parse version from version.py don't import · ab32741c
      Duncan Macleod authored
      its simpler to parse the version number from `ligo.gracedb.version`, rather than importing, so that `six` isn't required on the build machine _before_ building. importing in setup.py has also been seen to confuse some coverage parsers, and other profiling tools.
      ab32741c
  3. 12 Jul, 2018 6 commits
  4. 09 Jul, 2018 2 commits
  5. 08 Jul, 2018 3 commits
  6. 26 Jun, 2018 2 commits
  7. 31 May, 2018 3 commits
  8. 22 May, 2018 2 commits
  9. 17 May, 2018 3 commits
  10. 10 May, 2018 2 commits
  11. 08 May, 2018 1 commit
    • Leo Pound Singer's avatar
      Fix another unicode error on Python 3 · e34ff4b9
      Leo Pound Singer authored
      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
      e34ff4b9
  12. 07 May, 2018 4 commits
  13. 01 May, 2018 1 commit
  14. 24 Apr, 2018 8 commits