Permalink
Browse files

Fix #116: --spec local path issue on Windows

  • Loading branch information...
eliangcs committed May 10, 2017
1 parent 56448cd commit b14fe5d43502f46301da249a09f7d8f8e55a4db9
Showing with 4 additions and 4 deletions.
  1. +4 −4 http_prompt/cli.py
View
@@ -2,6 +2,7 @@
import json
import os
import re
import sys
import click
@@ -16,8 +17,7 @@
from pygments.styles import get_style_by_name
from pygments.util import ClassNotFound
from six.moves.http_cookies import SimpleCookie
from six.moves.urllib.parse import urlparse
from six.moves.urllib.request import urlopen
from six.moves.urllib.request import urlopen, pathname2url
from . import __version__
from . import config
@@ -75,8 +75,8 @@ def response_returned(self, context, response):
def normalize_url(ctx, param, value):
if value:
if not urlparse(value).scheme:
value = 'file://' + os.path.abspath(value)
if not re.search(r'^\w+://', value):
value = 'file:' + pathname2url(os.path.abspath(value))
return value
return None

0 comments on commit b14fe5d

Please sign in to comment.