URL without scheme raises uncaught `MissingSchema` exception
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2
- Forks
- 7
- Avg merge
- 6d 11h
- Merged PRs (30d)
- 2
Description
[pederhan@auspex ~]$ mreg-cli --url example.com
Traceback (most recent call last):
File "run.py", line 21, in <module>
File "mreg_cli/main.py", line 150, in main
File "mreg_cli/utilities/api.py", line 117, in try_token_or_login
File "requests/sessions.py", line 602, in get
File "requests/sessions.py", line 575, in request
File "requests/sessions.py", line 484, in prepare_request
File "requests/models.py", line 367, in prepare
File "requests/models.py", line 438, in prepare_url
requests.exceptions.MissingSchema: Invalid URL '/api/v1/hosts/': No scheme supplied. Perhaps you meant https:///api/v1/hosts/?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the command with mreg-cli --url example.com, then inspect mreg_cli/main.py and mreg_cli/utilities/api.py, especially the try_token_or_login path shown in the traceback. Determine how URLs without a scheme should be handled and verify that the command no longer exposes an uncaught requests.exceptions.MissingSchema error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100