peterbe: This is what happened:

```python
def foo(index_url="SOME_DEFAULT"):
    print(repr(index_url))


foo(index_url=None)
```

The output of that becomes:
```
None
```
peterbe: @nmacinnis I'm confident this PR fixes the problem and so I'm going to go ahead and land it. Again, sorry I didn't test this manually enough. 
diff --git a/README.rst b/README.rst
index 7f63630..3aefe28 100644
--- a/README.rst
+++ b/README.rst
@@ -270,8 +270,12 @@ put it directly into ``pip``.
 Version History
 ===============
 
+0.14.4
+  * Bugfix for new ``--index-url`` option feature in version 0.14.3.
+    See https://github.com/peterbe/hashin/issues/108
+
 0.14.3
-  * New parameterr ``--index-url`` which allows to override the default which
+  * New parameter ``--index-url`` which allows to override the default which
     is ``https://pypi.org``. Thanks @nmacinnis
     See https://github.com/peterbe/hashin/pull/107
 
diff --git a/hashin.py b/hashin.py
index a296359..cbc998c 100755
--- a/hashin.py
+++ b/hashin.py
@@ -47,6 +47,7 @@ else:
 DEFAULT_ALGORITHM = "sha256"
 
 DEFAULT_INDEX_URL = os.environ.get("INDEX_URL", "https://pypi.org/")
+assert DEFAULT_INDEX_URL
 
 MAX_WORKERS = None
 
@@ -159,6 +160,7 @@ def run_packages(
     synchronous=False,
     index_url=DEFAULT_INDEX_URL,
 ):
+    assert index_url
     assert isinstance(specs, list), type(specs)
     all_new_lines = []
     first_interactive = True
@@ -754,7 +756,7 @@ def get_parser():
     parser.add_argument(
         "--index-url",
         help="alternate package index url (default {0})".format(DEFAULT_INDEX_URL),
-        default=None,
+        default=DEFAULT_INDEX_URL,
     )
     return parser
 
diff --git a/setup.py b/setup.py
index 417cf50..e42b8ab 100644
--- a/setup.py
+++ b/setup.py
@@ -14,7 +14,7 @@ except ImportError:
 
 setup(
     name="hashin",
-    version="0.14.3",
+    version="0.14.4",
     description="Edits your requirements.txt by hashing them in",
     long_description=open(path.join(_here, "README.rst")).read(),
     author="Peter Bengtsson",

New --index-url option is broken
Shame on me for landing https://github.com/peterbe/hashin/pull/107 without properly testing it manually on the command line. 

```
▶ python hashin.py -r /tmp/reqs.txt DJANGO -v
Traceback (most recent call last):
  File "hashin.py", line 812, in <module>
    sys.exit(main())
  File "hashin.py", line 804, in main
    index_url=args.index_url,
  File "hashin.py", line 134, in run
    return run_packages(specs, requirements_file, *args, **kwargs)
  File "hashin.py", line 196, in run_packages
    index_url=index_url,
  File "hashin.py", line 655, in get_package_hashes
    data = get_package_data(package, index_url, verbose)
  File "hashin.py", line 583, in get_package_data
    content = json.loads(_download(url))
  File "hashin.py", line 88, in _download
    r = urlopen(url)
  File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 223, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 511, in open
    req = Request(fullurl, data)
  File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 329, in __init__
    self.full_url = url
  File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 355, in full_url
    self._parse()
  File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 384, in _parse
    raise ValueError("unknown url type: %r" % self.full_url)
ValueError: unknown url type: '/pypi/DJANGO/json'
```

The reason this happens is that `url` [on this line](https://github.com/peterbe/hashin/blob/c06eba0c55d55b82c72522363717108458d3f912/hashin.py#L580) becomes `/pypi/DJANGO/json`.

The reason is because `index_url` is `None` and that's how `urljoin` works. 
diff --git a/tests/test_arg_parse.py b/tests/test_arg_parse.py
index 23288db..ae52330 100644
--- a/tests/test_arg_parse.py
+++ b/tests/test_arg_parse.py
@@ -1,6 +1,6 @@
 import argparse
 
-from hashin import get_parser
+from hashin import get_parser, DEFAULT_INDEX_URL
 
 
 def test_everything():
@@ -85,6 +85,6 @@ def test_minimal():
         update_all=False,
         interactive=False,
         synchronous=False,
-        index_url=None,
+        index_url=DEFAULT_INDEX_URL,
     )
     assert args == (expected, [])

pip install -e .
parse_log_pytest
requirements.txt
pytest mock
3.6
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
attrs==22.2.0
certifi==2021.5.30
-e git+https://github.com/peterbe/hashin.git@ad75a2338bb1aa5ce6a56ac5288ad582fcbad65d#egg=hashin
importlib-metadata==4.8.3
iniconfig==1.1.1
mock==5.2.0
packaging==21.3
pip-api==0.0.26
pluggy==1.0.0
py==1.11.0
pyparsing==3.1.4
pytest==7.0.1
tomli==1.2.3
typing_extensions==4.1.1
zipp==3.6.0

name: hashin
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - attrs==22.2.0
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - mock==5.2.0
      - packaging==21.3
      - pip-api==0.0.26
      - pluggy==1.0.0
      - py==1.11.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - tomli==1.2.3
      - typing-extensions==4.1.1
      - zipp==3.6.0
prefix: /opt/conda/envs/hashin

tests/test_arg_parse.py::test_minimal
tests/test_arg_parse.py::test_everything tests/test_arg_parse.py::test_everything_long
README.rst hashin.py setup.py
README.rst hashin.py setup.py