Repository: pypa/pipenv

Issue:
Too few arguments for format string?
https://github.com/kennethreitz/pipenv/blob/33d739322865bbc2305068009ebd9fb2cfef9229/pipenv/cli.py#L223

`which_pip()` seems to only return a single string but `str.format` seems to be expecting two separate positional arguments.

```python
>>> '{0} {1}'.format('oops!')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
IndexError: tuple index out of range
```

I am guessing that `windows` is supposed to be that second argument and if that is the case, the closing bracket should simply be moved to include it.

```python
# old
c = delegator.run('"{0}" install {1} pip --upgrade'.format(which_pip()), windows, block=False) 

# new?
c = delegator.run('"{0}" install {1} pip --upgrade'.format(which_pip(), windows), block=False) 
```

I wasn't 100% sure that this was the correct solution though but if it is, I could also send a PR to fix it.

Thanks!

Too few arguments for format string?
https://github.com/kennethreitz/pipenv/blob/33d739322865bbc2305068009ebd9fb2cfef9229/pipenv/cli.py#L223

`which_pip()` seems to only return a single string but `str.format` seems to be expecting two separate positional arguments.

```python
>>> '{0} {1}'.format('oops!')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
IndexError: tuple index out of range
```

I am guessing that `windows` is supposed to be that second argument and if that is the case, the closing bracket should simply be moved to include it.

```python
# old
c = delegator.run('"{0}" install {1} pip --upgrade'.format(which_pip()), windows, block=False) 

# new?
c = delegator.run('"{0}" install {1} pip --upgrade'.format(which_pip(), windows), block=False) 
```

I wasn't 100% sure that this was the correct solution though but if it is, I could also send a PR to fix it.

Thanks!



Discussion:
@delirious-lettuce Yeah, this is definitely bad paren placement and I'm not sure how this hasn't been caught before. If you feel like opening a PR with your correction, that would be great!
Ok, thanks for clarifying! I would be glad to send a PR fixing it but I’d
have to do it in the morning (just shutdown my computer for the night, on
mobile right now). If you needed to fix it immediately though I would have
to leave it to you.

@delirious-lettuce, no problem, if you want to open it tomorrow, that's totally fine. Thanks!
Sure, no problem. Expect a PR in maybe 8-9 hours!

Thanks again for your time!

@delirious-lettuce Yeah, this is definitely bad paren placement and I'm not sure how this hasn't been caught before. If you feel like opening a PR with your correction, that would be great!
Ok, thanks for clarifying! I would be glad to send a PR fixing it but I’d
have to do it in the morning (just shutdown my computer for the night, on
mobile right now). If you needed to fix it immediately though I would have
to leave it to you.

@delirious-lettuce, no problem, if you want to open it tomorrow, that's totally fine. Thanks!
Sure, no problem. Expect a PR in maybe 8-9 hours!

Thanks again for your time!


Resolving patch:
diff --git a/pipenv/cli.py b/pipenv/cli.py
--- a/pipenv/cli.py
+++ b/pipenv/cli.py
@@ -220,7 +220,7 @@ def ensure_latest_pip():
 
             windows = '-m' if os.name == 'nt' else ''
 
-            c = delegator.run('"{0}" install {1} pip --upgrade'.format(which_pip()), windows, block=False)
+            c = delegator.run('"{0}" install {1} pip --upgrade'.format(which_pip(), windows), block=False)
             click.echo(crayons.blue(c.out))
     except AttributeError:
         pass


Test patch: