You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to create a card in a Github Enterprise repository the url that is built isn't for the Enterprise server, but for api.github.com.
Creating a project and columns worked fine, trying to read columns however had the same issue.
Since it is going to the github, where my project doesn't exist and I'm not authenticated I get the following error:
/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py:1013: InsecureRequestWarning: Unverified HTTPS request is being made to host 'api.github.com'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings
warnings.warn(
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.9/site-packages/github3/structs.py", line 120, in next
return self.__next__()
File "/usr/local/lib/python3.9/site-packages/github3/structs.py", line 106, in __next__
return next(self.__i__)
File "/usr/local/lib/python3.9/site-packages/github3/structs.py", line 76, in __iter__
json = self._get_json(response)
File "/usr/local/lib/python3.9/site-packages/github3/structs.py", line 109, in _get_json
return self._json(response, 200)
File "/usr/local/lib/python3.9/site-packages/github3/models.py", line 156, in _json
raise exceptions.error_for(response)
github3.exceptions.AuthenticationFailed: 401 Bad credentials
I believe it is because it is referencing self._github_url rather than self._api in projects.py, but I was unable to fix in the python debugger.
253defcreate_card_with_content_id(self, content_id, content_type):
254"""Create a content card in this project column.255 256 :param int content_id:257 (required), the ID of the content258 :param str content_type:259 (required), the type of the content260 :returns:261 the created card262 :rtype:263 :class:`~github3.projects.ProjectCard`264 """265ifnotcontent_idornotcontent_type:
266returnNone267268url=self._build_url(
269'projects/columns',
270str(self.id),
271'cards',
272base_url=self._github_url273 )
274json=None275data= {'content_id': content_id, 'content_type': content_type}
276json=self._json(self._post(
277url, data=data, headers=Project.CUSTOM_HEADERS), 201)
278returnself._instance_or_null(ProjectCard, json)
The text was updated successfully, but these errors were encountered:
I verified the issue is with the ._github_url. If I change that to point to my enterprise server col._github_url = 'https://api.github.[MYHOST] it works. I would do a pull request, but I don't know what the best way to fix it is, since I don't think it is a direct replacement with col._api.
When trying to create a card in a Github Enterprise repository the url that is built isn't for the Enterprise server, but for
api.github.com
.Creating a project and columns worked fine, trying to read columns however had the same issue.
Since it is going to the github, where my project doesn't exist and I'm not authenticated I get the following error:
I believe it is because it is referencing
self._github_url
rather thanself._api
inprojects.py
, but I was unable to fix in the python debugger.The text was updated successfully, but these errors were encountered: