Skip to content

Make "s" in "https" optional to match URL w/ regex #299

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

msabramo
Copy link
Contributor

@msabramo msabramo commented Nov 5, 2014

Some folks may be using a GitHub Enterprise server that doesn't support HTTPS.

Without this fix, I get errors when trying to use github-cli with our non-HTTPS-enabled GitHub Enterprise server.

$ gh -r devmonkeys/smstack issue.ls
Traceback (most recent call last):
  File "/Users/marca/python/virtualenvs/github-cli/bin/gh", line 9, in <module>
    load_entry_point('gh-cli==0.1.b', 'console_scripts', 'gh')()
  File "/Users/marca/dev/git-repos/github-cli/gh/main.py", line 29, in main
    status = commands[command].run(opts, args[1:])
  File "/Users/marca/dev/git-repos/github-cli/gh/commands/issue/ls.py", line 56, in run
    return self.print_issues(opts)
  File "/Users/marca/dev/git-repos/github-cli/gh/commands/issue/ls.py", line 86, in print_issues
    for i in issues:
  File "/Users/marca/python/virtualenvs/github-cli/lib/python2.7/site-packages/github3/structs.py", line 82, in __iter__
    yield cls(i, self) if issubclass(cls, GitHubCore) else cls(i)
  File "/Users/marca/python/virtualenvs/github-cli/lib/python2.7/site-packages/github3/issues/issue.py", line 83, in __init__
    self.repository = m.groups()
AttributeError: 'NoneType' object has no attribute 'groups'

Some folks may be using a GitHub Enterprise server that doesn't support
HTTPS.
@msabramo
Copy link
Contributor Author

msabramo commented Nov 5, 2014

FYI: Same problem seems to exist in the 1.0-alpha branch.

$ gco 1.0-alpha
Switched to branch '1.0-alpha'
Your branch is up-to-date with 'origin/1.0-alpha'.

$ git rev-parse HEAD
7b3f589d36b151a05536d2ffb02d2ac192629707

$ ag 'match.*https:' github3
github3/github.py
901:        m = match('https://[\w\d\-\.\:]+/\w+/[\w\._-]+/events/\w+', topic)

github3/issues/issue.py
81:        m = match('https://[\w\d\-\.\:]+/(\S+)/(\S+)/(?:issues|pull)/\d+',

github3/pulls.py
166:        m = match('https://[\w\d\-\.\:]+/(\S+)/(\S+)/(?:issues|pull)?/\d+',

@sigmavirus24
Copy link
Owner

Shame on you for not using https ;)

sigmavirus24 added a commit that referenced this pull request Nov 8, 2014
…ex_matches

Make "s" in "https" optional to match URL w/ regex
@sigmavirus24 sigmavirus24 merged commit e2a129a into sigmavirus24:develop Nov 8, 2014
@sigmavirus24
Copy link
Owner

Thanks!

@msabramo
Copy link
Contributor Author

msabramo commented Nov 8, 2014

Shame on you for not using https ;)

Yeah, I know. I've been pestering folks to buy the SSL certificate once a month for about a year now.

At least it's on our internal network.

@msabramo msabramo deleted the make_https_optional_for_url_regex_matches branch November 8, 2014 05:03
@jquast
Copy link

jquast commented Apr 1, 2015

Thanks... ran into the same issue, sadly the latest version on pypi is still without the fix ??

Also note that I am using https with github enterprise, the api provides non-https urls for some reason.

@sigmavirus24
Copy link
Owner

@jquast I'll add it to my todo list to cut an 0.9.4 release from stable/0.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants