LanceMaverick / skybeard-2

The omniscient telegram bot is back. Now in python 3 and based on a plug-in system
Other
6 stars 4 forks source link

Odd exception in repo_helper for pygithub3 #126

Open natfarleydev opened 7 years ago

natfarleydev commented 7 years ago

In line https://github.com/LanceMaverick/skybeard-2/blob/skb-dev/beards/repo_helper/python/repo_helper/__init__.py#L43 it complains about not finding github.GithubException.UnknownObjectException after raising github.GithubException.UnknownObjectException.

Traceback (most recent call last):
  File "/home/telegram/git/farleyjohnsbot/beards/repo_helper/python/repo_helper/__init__.py", line 39, in make_repo_yaml
    "name": repo.name,
  File "/home/telegram/.pyenv/versions/skybeard/lib/python3.5/site-packages/github/Repository.py", line 436, in name
    self._completeIfNotSet(self._name)
  File "/home/telegram/.pyenv/versions/skybeard/lib/python3.5/site-packages/github/GithubObject.py", line 251, in _completeIfNotSet
    self._completeIfNeeded()
  File "/home/telegram/.pyenv/versions/skybeard/lib/python3.5/site-packages/github/GithubObject.py", line 255, in _completeIfNeeded
    self.__complete()
  File "/home/telegram/.pyenv/versions/skybeard/lib/python3.5/site-packages/github/GithubObject.py", line 260, in __complete
    self._url.value
  File "/home/telegram/.pyenv/versions/skybeard/lib/python3.5/site-packages/github/Requester.py", line 172, in requestJsonAndCheck
    return self.__check(*self.requestJson(verb, url, parameters, headers, input, cnx))
  File "/home/telegram/.pyenv/versions/skybeard/lib/python3.5/site-packages/github/Requester.py", line 180, in __check
    raise self.__createException(status, responseHeaders, output)
github.GithubException.UnknownObjectException: 404 {'message': 'Not Found', 'documentation_url': 'https://developer.github.com/v3'}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/telegram/.pyenv/versions/skybeard/lib/python3.5/site-packages/telepot/aio/delegate.py", line 87, in wait_loop
    await helper._yell(j.on_message, msg)
  File "/home/telegram/.pyenv/versions/skybeard/lib/python3.5/site-packages/telepot/aio/helper.py", line 16, in _yell
    return await fn(*args, **kwargs)
  File "/home/telegram/.pyenv/versions/skybeard/lib/python3.5/site-packages/telepot/aio/helper.py", line 181, in augmented
    return await _yell(handler, msg)
  File "/home/telegram/.pyenv/versions/skybeard/lib/python3.5/site-packages/telepot/aio/helper.py", line 16, in _yell
    return await fn(*args, **kwargs)
  File "/home/telegram/.pyenv/versions/skybeard/lib/python3.5/site-packages/telepot/aio/helper.py", line 257, in on_message
    await self._router.route(msg)
  File "/home/telegram/.pyenv/versions/skybeard/lib/python3.5/site-packages/telepot/aio/helper.py", line 234, in route
    return await _yell(fn, msg, *args, **kwargs)
  File "/home/telegram/.pyenv/versions/skybeard/lib/python3.5/site-packages/telepot/aio/helper.py", line 16, in _yell
    return await fn(*args, **kwargs)
  File "/home/telegram/.pyenv/versions/skybeard/lib/python3.5/site-packages/telepot/aio/helper.py", line 24, in d
    return await _yell(method, *a, **kw)
  File "/home/telegram/.pyenv/versions/skybeard/lib/python3.5/site-packages/telepot/aio/helper.py", line 16, in _yell
    return await fn(*args, **kwargs)
  File "/home/telegram/git/farleyjohnsbot/skybeard/beards.py", line 315, in on_chat_message
    await getattr(self, cmd.coro)(msg)
  File "/home/telegram/git/farleyjohnsbot/skybeard/decorators.py", line 63, in g
    raise e
  File "/home/telegram/git/farleyjohnsbot/skybeard/decorators.py", line 54, in g
    return await f_or_text(beard, *fargs, **fkwargs)
  File "/home/telegram/git/farleyjohnsbot/beards/repo_helper/python/repo_helper/__init__.py", line 43, in make_repo_yaml
    except github.GithubException.UnknownObjectException:
AttributeError: type object 'GithubException' has no attribute 'UnknownObjectException'

Very curious.

It may be worth abandoning the pygithub3 dependency for this beard in favour of raw aiohttp anyway to avoid this. (fewer dependencies, fewer problems.)

LanceMaverick commented 7 years ago

fewer dependencies, fewer problems.

+1 !