ValueError when using gh pull-requests on github enterprise.
Opened this issue · 4 comments
milin commented
❯ gh pull-requests
Traceback (most recent call last):
File "/home/vagrant/.virtualenvs/gitsome/bin/gh", line 11, in <module>
sys.exit(cli())
File "/home/vagrant/.virtualenvs/gitsome/lib/python3.5/site-packages/gitsome/main_cli.py", line 26, in cli
github.cli()
File "/home/vagrant/.virtualenvs/gitsome/lib/python3.5/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/home/vagrant/.virtualenvs/gitsome/lib/python3.5/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/home/vagrant/.virtualenvs/gitsome/lib/python3.5/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/vagrant/.virtualenvs/gitsome/lib/python3.5/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/vagrant/.virtualenvs/gitsome/lib/python3.5/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/home/vagrant/.virtualenvs/gitsome/lib/python3.5/site-packages/click/decorators.py", line 64, in new_func
return ctx.invoke(f, obj, *args[1:], **kwargs)
File "/home/vagrant/.virtualenvs/gitsome/lib/python3.5/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/home/vagrant/.virtualenvs/gitsome/lib/python3.5/site-packages/gitsome/githubcli.py", line 555, in pull_requests
github.pull_requests(limit, pager)
File "/home/vagrant/.virtualenvs/gitsome/lib/python3.5/site-packages/gitsome/github.py", line 86, in auth_wrapper
return func(self, *args, **kwargs)
File "/home/vagrant/.virtualenvs/gitsome/lib/python3.5/site-packages/gitsome/github.py", line 558, in pull_requests
user, repo, issues, number = url.split('/')
ValueError: too many values to unpack (expected 4)
Some more context.
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬
> /home/vagrant/.virtualenvs/gitsome/lib/python3.5/site-packages/gitsome/github.py(559)pull_requests() │
558 import ipdb; ipdb.set_trace() # XXX BREAKPOINT │
--> 559 user, repo, issues, number = url.split('/') │
560 repo_pull = self.config.api.pull_request(user, repo, number) │
│
ipdb> url │
'api/v3/repos/ABC/ProjectX/issues/165' │
ipdb> url.split('/') │
['api', 'v3', 'repos', 'ABC', 'ProjectX', 'issues', '165'] │
ipdb> n │
ValueError: too many values to unpack (expected 4) │
> /home/vagrant/.virtualenvs/gitsome/lib/python3.5/site-packages/gitsome/github.py(559)pull_requests() │
558 import ipdb; ipdb.set_trace() # XXX BREAKPOINT │
--> 559 user, repo, issues, number = url.split('/') │
560 repo_pull = self.config.api.pull_request(user, repo, number) │
│
ipdb> │
donnemartin commented
Hi @milin, thanks for the report!
I see this working on my end without using GH Enterprise. Could you verify if this is an Enterprise-only issue?
milin commented
I can reproduce this always when using it with gh enterprise. Let me try it with gh and see if i can reproduce.
milin commented
gh pull-requests
works without any issues pointing to github. Looks like it's only an issue with github enterprise.
donnemartin commented
Thanks confirming this is a GH Enterprise issue!