# Buggy code
def install_actions_list(
    prefix,
    index,
    specs,
    force=False,
    only_names=None,
    always_copy=False,
    pinned=True,
    minimal_hint=False,
    update_deps=True,
    prune=False,
    channel_priority_map=None,
    is_update=False,
):
    # type: (str, Dict[Dist, Record], List[str], bool, Option[List[str]], bool, bool, bool,
    #        bool, bool, bool, Dict[str, Sequence[str, int]]) -> List[Dict[weird]]
    str_specs = specs
    specs = [MatchSpec(spec) for spec in specs]
    r = get_resolve_object(index.copy(), prefix)

    linked_in_root = linked_data(context.root_prefix)

    dists_for_envs = determine_all_envs(
        r, specs, channel_priority_map=channel_priority_map
    )
    ensure_packge_not_duplicated_in_private_env_root(dists_for_envs, linked_in_root)
    preferred_envs = set(d.env for d in dists_for_envs)

    # Group specs by prefix
    grouped_specs = determine_dists_per_prefix(
        r, prefix, index, preferred_envs, dists_for_envs, context
    )

    # Replace SpecsForPrefix specs with specs that were passed in in order to retain
    #   version information
    required_solves = match_to_original_specs(str_specs, grouped_specs)

    actions = [
        get_actions_for_dists(
            dists_by_prefix,
            only_names,
            index,
            force,
            always_copy,
            prune,
            update_deps,
            pinned,
        )
        for dists_by_prefix in required_solves
    ]

    # Need to add unlink actions if updating a private env from root
    if is_update and prefix == context.root_prefix:
        add_unlink_options_for_update(actions, required_solves, index)

    return actions


# Traceback (KeyError)
$ conda info -a
Current conda install:

platform : linux-64
conda version : 4.3.13
conda is private : False
conda-env version : 4.3.13
conda-build version : 2.0.2
python version : 2.7.12.final.0
requests version : 2.13.0
root environment : /home/hp/bin/anaconda2  (writable)
default environment : /home/hp/bin/anaconda2/envs/kapsel
envs directories : /home/hp/bin/anaconda2/envs
/home/hp/.conda/envs
package cache : /home/hp/bin/anaconda2/pkgs
/home/hp/.conda/pkgs
channel URLs : https://repo.continuum.io/pkgs/free/linux-64
https://repo.continuum.io/pkgs/free/noarch
https://repo.continuum.io/pkgs/r/linux-64
https://repo.continuum.io/pkgs/r/noarch
https://repo.continuum.io/pkgs/pro/linux-64
https://repo.continuum.io/pkgs/pro/noarch
https://conda.anaconda.org/t/<TOKEN>/binstar/linux-64
https://conda.anaconda.org/t/<TOKEN>/binstar/noarch
config file : /home/hp/.condarc
offline mode : False
user-agent : conda/4.3.13 requests/2.13.0 CPython/2.7.12 Linux/4.9.12-100.fc24.x86_64 Fedora/24 glibc/2.23
UID:GID : 1000:1000

# conda environments:
#
anaconda-platform        /home/hp/bin/anaconda2/envs/anaconda-platform
kapsel                *  /home/hp/bin/anaconda2/envs/kapsel
kapsel-canary            /home/hp/bin/anaconda2/envs/kapsel-canary
py2                      /home/hp/bin/anaconda2/envs/py2
testing                  /home/hp/bin/anaconda2/envs/testing
root                     /home/hp/bin/anaconda2

sys.version: 2.7.12 |Anaconda 4.2.0 (64-bit)| (defaul...
sys.prefix: /home/hp/bin/anaconda2
sys.executable: /home/hp/bin/anaconda2/bin/python
conda location: /home/hp/bin/anaconda2/lib/python2.7/site-packages/conda
conda-build: /home/hp/bin/anaconda2/bin/conda-build
conda-convert: /home/hp/bin/anaconda2/bin/conda-convert
conda-develop: /home/hp/bin/anaconda2/bin/conda-develop
conda-env: /home/hp/bin/anaconda2/bin/conda-env
conda-index: /home/hp/bin/anaconda2/bin/conda-index
conda-inspect: /home/hp/bin/anaconda2/bin/conda-inspect
conda-kapsel: /home/hp/bin/anaconda2/envs/kapsel/bin/conda-kapsel
conda-metapackage: /home/hp/bin/anaconda2/bin/conda-metapackage
conda-render: /home/hp/bin/anaconda2/bin/conda-render
conda-server: /home/hp/bin/anaconda2/envs/kapsel/bin/conda-server
conda-sign: /home/hp/bin/anaconda2/bin/conda-sign
conda-skeleton: /home/hp/bin/anaconda2/bin/conda-skeleton
user site dirs:

CIO_TEST: <not set>
CONDA_DEFAULT_ENV: kapsel
CONDA_ENVS_PATH: <not set>
LD_LIBRARY_PATH: <not set>
PATH: /home/hp/bin/anaconda2/envs/kapsel/bin:/home/hp/bin:/usr/lib64/qt-3.3/bin:/usr/lib64/ccache:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin
PYTHONHOME: <not set>
PYTHONPATH: <not set>

License directories:
/home/hp/.continuum
/home/hp/bin/anaconda2/licenses
License files (license*.txt):
/home/hp/.continuum/license_anaconda_repo_20161003210957.txt
Reading license file : 1
Error: no signature in license: {u'license': u'test'}
Signature valid : 0
Vendor match : 0
/home/hp/.continuum/license_anaconda_repo_20160804160500.txt
Reading license file : 1
Error: no signature in license: {u'license': u'test'}
Signature valid : 0
Vendor match : 0
/home/hp/.continuum/license_anaconda_repo_20160727174434.txt
Reading license file : 1
Error: no signature in license: {u'license': u'test'}
Signature valid : 0
Vendor match : 0
/home/hp/.continuum/license_anaconda_repo_20160728092403.txt
Reading license file : 1
Error: no signature in license: {u'license': u'test'}
Signature valid : 0
Vendor match : 0
/home/hp/.continuum/license_anaconda_repo_20160830123618.txt
Reading license file : 1
Error: no signature in license: {u'license': u'test'}
Signature valid : 0
Vendor match : 0
/home/hp/.continuum/license_anaconda_repo_20160803091557.txt
Reading license file : 1
Error: no signature in license: {u'license': u'test'}
Signature valid : 0
Vendor match : 0
/home/hp/.continuum/license_anaconda_repo_20160830104354.txt
Reading license file : 1
Error: no signature in license: {u'license': u'test'}
Signature valid : 0
Vendor match : 0
/home/hp/.continuum/license_anaconda_repo.txt
Reading license file : 6
Signature valid : 6
Vendor match : 3
product : u'mkl-optimizations'
packages : u'mkl'
end_date : u'2017-05-24'
type : u'Trial'
product : u'iopro'
packages : u'iopro'
end_date : u'2017-05-24'
type : u'Trial'
product : u'accelerate'
packages : u'numbapro mkl'
end_date : u'2017-05-24'
type : u'Trial'
/home/hp/.continuum/license_anaconda_repo_20160823133054.txt
Reading license file : 1
Error: no signature in license: {u'license': u'test'}
Signature valid : 0
Vendor match : 0
/home/hp/.continuum/license_anaconda_repo_20160927143648.txt
Reading license file : 1
Error: no signature in license: {u'license': u'test'}
Signature valid : 0
Vendor match : 0
/home/hp/.continuum/license_anaconda_repo_20160803113033.txt
Reading license file : 1
Error: no signature in license: {u'license': u'test'}
Signature valid : 0
Vendor match : 0
/home/hp/.continuum/license_anaconda_repo_20160728095857.txt
Reading license file : 1
Error: no signature in license: {u'license': u'test'}
Signature valid : 0
Vendor match : 0
/home/hp/.continuum/license_anaconda_repo_20160728094900.txt
Reading license file : 1
Error: no signature in license: {u'license': u'test'}
Signature valid : 0
Vendor match : 0
/home/hp/.continuum/license_anaconda_repo_20160830104619.txt
Reading license file : 1
Error: no signature in license: {u'license': u'test'}
Signature valid : 0
Vendor match : 0
/home/hp/.continuum/license_anaconda_repo_20160728093131.txt
Reading license file : 1
Error: no signature in license: {u'license': u'test'}
Signature valid : 0
Vendor match : 0
/home/hp/.continuum/license_anaconda_repo_20161003210908.txt
Reading license file : 1
Error: no signature in license: {u'license': u'test'}
Signature valid : 0
Vendor match : 0
/home/hp/.continuum/license_anaconda_repo_20160728094321.txt
Reading license file : 1
Error: no signature in license: {u'license': u'test'}
Signature valid : 0
Vendor match : 0
Package/feature end dates:
An unexpected error has occurred.
Please consider posting the following information to the
conda GitHub issue tracker at:

https://github.com/conda/conda/issues



`$ /home/hp/bin/anaconda2/envs/kapsel/bin/conda info -a`




Traceback (most recent call last):
File "/home/hp/bin/anaconda2/lib/python2.7/site-packages/conda/exceptions.py", line 591, in conda_exception_handler
return_value = func(*args, **kwargs)
File "/home/hp/bin/anaconda2/lib/python2.7/site-packages/conda/cli/main.py", line 134, in _main
exit_code = args.func(args, p)
File "/home/hp/bin/anaconda2/lib/python2.7/site-packages/conda/cli/main_info.py", line 324, in execute
show_info()
File "_license.pyx", line 363, in _license.show_info (_license.c:10610)
File "_license.pyx", line 310, in _license.get_end_dates (_license.c:9015)
File "_license.pyx", line 166, in _license.filter_vendor (_license.c:6214)
KeyError: 'vendor'

$ conda --version
conda 4.3.13

# Fixed code
def install_actions_list(
    prefix,
    index,
    specs,
    force=False,
    only_names=None,
    always_copy=False,
    pinned=True,
    minimal_hint=False,
    update_deps=True,
    prune=False,
    channel_priority_map=None,
    is_update=False,
):
    # type: (str, Dict[Dist, Record], List[str], bool, Option[List[str]], bool, bool, bool,
    #        bool, bool, bool, Dict[str, Sequence[str, int]]) -> List[Dict[weird]]
    specs = [MatchSpec(spec) for spec in specs]
    r = get_resolve_object(index.copy(), prefix)

    linked_in_root = linked_data(context.root_prefix)

    dists_for_envs = determine_all_envs(
        r, specs, channel_priority_map=channel_priority_map
    )
    ensure_packge_not_duplicated_in_private_env_root(dists_for_envs, linked_in_root)
    preferred_envs = set(d.env for d in dists_for_envs)

    # Group specs by prefix
    grouped_specs = determine_dists_per_prefix(
        r, prefix, index, preferred_envs, dists_for_envs, context
    )

    # Replace SpecsForPrefix specs with specs that were passed in in order to retain
    #   version information
    required_solves = match_to_original_specs(specs, grouped_specs)

    actions = [
        get_actions_for_dists(
            specs_by_prefix,
            only_names,
            index,
            force,
            always_copy,
            prune,
            update_deps,
            pinned,
        )
        for specs_by_prefix in required_solves
    ]

    # Need to add unlink actions if updating a private env from root
    if is_update and prefix == context.root_prefix:
        add_unlink_options_for_update(actions, required_solves, index)

    return actions