httpie / http-prompt

An interactive command-line HTTP and API testing client built on top of HTTPie featuring autocomplete, syntax highlighting, and more. https://twitter.com/httpie
https://http-prompt.com
MIT License
8.96k stars 326 forks source link

--spec with absolute local file path crashes on Windows #116

Closed eliangcs closed 7 years ago

eliangcs commented 7 years ago
>http-prompt --spec "C:\test.json"
Version: 0.10.0
Traceback (most recent call last):
  File "C:\Users\IEUser\venv\Scripts\http-prompt-script.py", line 11, in <module>
    load_entry_point('http-prompt==0.10.0', 'console_scripts', 'http-prompt')()
  File "c:\users\ieuser\venv\lib\site-packages\click\core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "c:\users\ieuser\venv\lib\site-packages\click\core.py", line 697, in main
    rv = self.invoke(ctx)
  File "c:\users\ieuser\venv\lib\site-packages\click\core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\users\ieuser\venv\lib\site-packages\click\core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "c:\users\ieuser\venv\lib\site-packages\http_prompt\cli.py", line 107, in cli
    f = urlopen(spec)
  File "c:\python35\Lib\urllib\request.py", line 163, in urlopen
    return opener.open(url, data, timeout)
  File "c:\python35\Lib\urllib\request.py", line 466, in open
    response = self._open(req, data)
  File "c:\python35\Lib\urllib\request.py", line 489, in _open
    'unknown_open', req)
  File "c:\python35\Lib\urllib\request.py", line 444, in _call_chain
    result = func(*args)
  File "c:\python35\Lib\urllib\request.py", line 1324, in unknown_open
    raise URLError('unknown url type: %s' % type)
urllib.error.URLError: <urlopen error unknown url type: c>