# Buggy code
def _pip_install_via_requirements(prefix, specs, args, *_):
    """
    Installs the pip dependencies in specs using a temporary pip requirements file.

    Args
    ----
    prefix: string
      The path to the python and pip executables.

    specs: iterable of strings
      Each element should be a valid pip dependency.
      See: https://pip.pypa.io/en/stable/user_guide/#requirements-files
           https://pip.pypa.io/en/stable/reference/pip_install/#requirements-file-format
    """
    try:
        pip_workdir = op.dirname(op.abspath(args.file))
    except AttributeError:
        pip_workdir = None
    requirements = None
    try:
        # Generate the temporary requirements file
        requirements = tempfile.NamedTemporaryFile(
            mode="w",
            prefix="condaenv.",
            suffix=".requirements.txt",
            dir=pip_workdir,
            delete=False,
        )
        requirements.write("\n".join(specs))
        requirements.close()
        # pip command line...
        pip_cmd = pip_args(prefix) + ["install", "-r", requirements.name]
        # ...run it
        process = subprocess.Popen(pip_cmd, cwd=pip_workdir, universal_newlines=True)
        process.communicate()
        if process.returncode != 0:
            raise CondaValueError("pip returned an error")
    finally:
        # Win/Appveyor does not like it if we use context manager + delete=True.
        # So we delete the temporary file in a finally block.
        if requirements is not None and op.isfile(requirements.name):
            os.remove(requirements.name)


# Traceback (TypeError)
{
"command":"/home/travis/miniconda/bin/conda-env update",
"conda_info":{
"GID":2000,
"UID":2000,
"_channels":"https://conda.anaconda.org/conda-canary/linux-64
https://conda.anaconda.org/conda-canary/noarch
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",
"_config_files":"/home/travis/.condarc",
"_envs_dirs":"/home/travis/miniconda/envs
/home/travis/.conda/envs",
"_pkgs_dirs":"/home/travis/miniconda/pkgs
/home/travis/.conda/pkgs",
"_rtwro":"writable",
"active_prefix":null,
"active_prefix_name":null,
"channels":[
"https://conda.anaconda.org/conda-canary/linux-64",
"https://conda.anaconda.org/conda-canary/noarch",
"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"
],
"conda_build_version":"not installed",
"conda_env_version":"4.4.0rc0",
"conda_location":"/home/travis/miniconda/lib/python3.6/site-packages/conda",
"conda_prefix":"/home/travis/miniconda",
"conda_private":false,
"conda_shlvl":-1,
"conda_version":"4.4.0rc0",
"config_files":[
"/home/travis/.condarc"
],
"default_prefix":"/home/travis/miniconda",
"envs":[

],
"envs_dirs":[
"/home/travis/miniconda/envs",
"/home/travis/.conda/envs"
],
"netrc_file":null,
"offline":false,
"pkgs_dirs":[
"/home/travis/miniconda/pkgs",
"/home/travis/.conda/pkgs"
],
"platform":"linux-64",
"python_version":"3.6.1.final.0",
"rc_path":"/home/travis/.condarc",
"requests_version":"2.14.2",
"root_prefix":"/home/travis/miniconda",
"root_writable":true,
"sys_rc_path":"/home/travis/miniconda/.condarc",
"user_agent":"conda/4.4.0rc0 requests/2.14.2 CPython/3.6.1 Linux/4.4.0-83-generic ubuntu/14.04 glibc/2.19",
"user_rc_path":"/home/travis/.condarc"
},
"error":"TypeError(\"_pip_install_via_requirements() got an unexpected keyword argument 'prune'\",)",
"exception_name":"TypeError",
"exception_type":"<class 'TypeError'>",
"traceback":"Traceback (most recent call last):
File \"/home/travis/miniconda/lib/python3.6/site-packages/conda/exceptions.py\", line 653, in __call__
return func(*args, **kwargs)
File \"/home/travis/miniconda/lib/python3.6/site-packages/conda_env/cli/main_update.py\", line 107, in execute
installer.install(prefix, specs, args, env, prune=args.prune)
TypeError: _pip_install_via_requirements() got an unexpected keyword argument 'prune'
"
}

# Fixed code
def _pip_install_via_requirements(prefix, specs, args, *_, **kwargs):
    """
    Installs the pip dependencies in specs using a temporary pip requirements file.

    Args
    ----
    prefix: string
      The path to the python and pip executables.

    specs: iterable of strings
      Each element should be a valid pip dependency.
      See: https://pip.pypa.io/en/stable/user_guide/#requirements-files
           https://pip.pypa.io/en/stable/reference/pip_install/#requirements-file-format
    """
    try:
        pip_workdir = op.dirname(op.abspath(args.file))
    except AttributeError:
        pip_workdir = None
    requirements = None
    try:
        # Generate the temporary requirements file
        requirements = tempfile.NamedTemporaryFile(
            mode="w",
            prefix="condaenv.",
            suffix=".requirements.txt",
            dir=pip_workdir,
            delete=False,
        )
        requirements.write("\n".join(specs))
        requirements.close()
        # pip command line...
        pip_cmd = pip_args(prefix) + ["install", "-r", requirements.name]
        # ...run it
        process = subprocess.Popen(pip_cmd, cwd=pip_workdir, universal_newlines=True)
        process.communicate()
        if process.returncode != 0:
            raise CondaValueError("pip returned an error")
    finally:
        # Win/Appveyor does not like it if we use context manager + delete=True.
        # So we delete the temporary file in a finally block.
        if requirements is not None and op.isfile(requirements.name):
            os.remove(requirements.name)