Repository: conda/conda

Issue:
`conda install` on missing packages tracebacks if multiline pinned file exists
If you attempt to install a non-existent package into an environment with a pinned file containing more than one entry, conda will traceback. Here's an example `pinned` file:

```
pip ==9.0.1
requests ==2.13.0
```

Subsequently, `conda install foobar` will produce this traceback: 

```
`$ F:\miniconda3_4.3.16_x64\Scripts\conda-script.py install foobar`


    Traceback (most recent call last):
      File "F:\miniconda3_4.3.16_x64\lib\site-packages\conda\cli\install.py", line 251, in install
        channel_priority_map=_channel_priority_map, is_update=isupdate)
      File "F:\miniconda3_4.3.16_x64\lib\site-packages\conda\plan.py", line 474, in install_actions_
list
        dists_for_envs = determine_all_envs(r, specs, channel_priority_map=channel_priority_map)
      File "F:\miniconda3_4.3.16_x64\lib\site-packages\conda\plan.py", line 539, in determine_all_en
vs
        spec_for_envs = tuple(SpecForEnv(env=p.preferred_env, spec=p.name) for p in best_pkgs)
      File "F:\miniconda3_4.3.16_x64\lib\site-packages\conda\plan.py", line 539, in <genexpr>
        spec_for_envs = tuple(SpecForEnv(env=p.preferred_env, spec=p.name) for p in best_pkgs)
      File "F:\miniconda3_4.3.16_x64\lib\site-packages\conda\plan.py", line 538, in <genexpr>
        best_pkgs = (r.index[r.get_dists_for_spec(s, emptyok=False)[-1]] for s in specs)
      File "F:\miniconda3_4.3.16_x64\lib\site-packages\conda\resolve.py", line 564, in get_dists_for
_spec
        raise NoPackagesFoundError([(ms,)])
    conda.exceptions.NoPackagesFoundError: Package missing in current win-64 channels:
      - foobar

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "F:\miniconda3_4.3.16_x64\lib\site-packages\conda\exceptions.py", line 626, in conda_exce
ption_handler
        return_value = func(*args, **kwargs)
      File "F:\miniconda3_4.3.16_x64\lib\site-packages\conda\cli\main.py", line 134, in _main
        exit_code = args.func(args, p)
      File "F:\miniconda3_4.3.16_x64\lib\site-packages\conda\cli\main_install.py", line 80, in execu
te
        install(args, parser, 'install')
      File "F:\miniconda3_4.3.16_x64\lib\site-packages\conda\cli\install.py", line 303, in install
        error_message.append("\n\n    %r" % pinned_specs)
    TypeError: not all arguments converted during string formatting
```
Fix for this issue in #4993.


Discussion:

Resolving patch:
diff --git a/conda/cli/install.py b/conda/cli/install.py
--- a/conda/cli/install.py
+++ b/conda/cli/install.py
@@ -300,7 +300,7 @@ def install(args, parser, command='install'):
             if pinned_specs:
                 path = join(prefix, 'conda-meta', 'pinned')
                 error_message.append("\n\nNote that you have pinned specs in %s:" % path)
-                error_message.append("\n\n    %r" % pinned_specs)
+                error_message.append("\n\n    %r" % (pinned_specs,))
 
             error_message = ''.join(error_message)
             raise PackageNotFoundError(error_message)


Test patch: