Skip to content

Bug in repr(PublicKey) #1878

@schlitzered

Description

@schlitzered

hi there.

there is a bug in "repo.get_public_key".

i found this bug by trying to use "repo.create_secret", which failed because of this issue

repo.get_public_key()
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/Users/sschultchen/PycharmProjects/IAC_Main/venv/lib/python3.9/site-packages/github/PublicKey.py", line 55, in __repr__
    return self.get__repr__({"key_id": self._key_id.value, "key": self._key.value})
  File "/Users/sschultchen/PycharmProjects/IAC_Main/venv/lib/python3.9/site-packages/github/GithubObject.py", line 62, in value
    raise GithubException.BadAttributeException(
github.GithubException.BadAttributeException: (1, <class 'str'>, None)

i guess the reason for this might be that the pygithub implementation assumes that "key_id" is a string, but it actually is a integer.

at least, the github api gives me an integer, and not a string for this attribute.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions