internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: conda/conda

Issue:
Suppress full stack trace for UnicodeEncodeError and UnicodeDecodeError in python 2
Decline to handle UnicodeEncodeError and UnicodeDecodeError when python2 is the interpreter under which conda is running.

If you encounter this problem, consider downloading Miniconda3 or Anaconda3.


Discussion:

Resolving patch:
diff --git a/conda/exceptions.py b/conda/exceptions.py
--- a/conda/exceptions.py
+++ b/conda/exceptions.py
@@ -13,7 +13,7 @@
 from ._vendor.auxlib.ish import dals
 from ._vendor.auxlib.type_coercion import boolify
 from .base.constants import PathConflict, SafetyChecks
-from .common.compat import ensure_text_type, input, iteritems, iterkeys, on_win, string_types
+from .common.compat import ensure_text_type, input, iteritems, iterkeys, on_win, string_types, PY2
 from .common.io import timeout
 from .common.signals import get_signal_name
 from .common.url import maybe_unquote
@@ -656,6 +656,25 @@ def __init__(self, invalid_spec):
         super(InvalidVersionSpecError, self).__init__(message, invalid_spec=invalid_spec)
 
 
+class EncodingError(CondaError):
+
+    def __init__(self, caused_by, **kwargs):
+        message = dals("""
+        A unicode encoding or decoding error has occurred.
+        Python 2 is the interpreter under which conda is running in your base environment.
+        Replacing your base environment with one having Python 3 may help resolve this issue.
+        If you still have a need for Python 2 environments, consider using 'conda create'
+        and 'conda activate'.  For example:
+
+            $ conda create -n py2 python=2
+            $ conda activate py2
+
+        Error details: %r
+
+        """) % caused_by
+        super(EncodingError, self).__init__(message, caused_by=caused_by, **kwargs)
+
+
 def maybe_raise(error, context):
     if isinstance(error, CondaMultiError):
         groups = groupby(lambda e: isinstance(e, ClobberError), error.errors)
@@ -752,6 +771,8 @@ def handle_exception(self, exc_val, exc_tb):
             return 0
         elif isinstance(exc_val, CondaError):
             return self.handle_application_exception(exc_val, exc_tb)
+        elif isinstance(exc_val, UnicodeError) and PY2:
+            return self.handle_application_exception(EncodingError(exc_val), exc_tb)
         elif isinstance(exc_val, KeyboardInterrupt):
             self._print_conda_exception(CondaError("KeyboardInterrupt"), _format_exc())
             return 1


Test patch:
Repository: conda/conda

Issue:
KeyError(u'CONDA_PREFIX',)
```
error: KeyError(u'CONDA_PREFIX',)
command: D:\Anaconda2\Scripts\conda shell.cmd.exe deactivate deactivate
user_agent: conda/4.4.4 requests/2.18.4 CPython/2.7.14 Windows/10 Windows/10.0.16299
_messageid: -9223372036842425555
_messagetime: 1514685063692 / 2017-12-30 19:51:03

Traceback (most recent call last):
  File "D:\Anaconda2\lib\site-packages\conda\cli\main.py", line 111, in main
    return activator_main()
  File "D:\Anaconda2\lib\site-packages\conda\activate.py", line 529, in main
    sys.stdout.write(activator.execute())
  File "D:\Anaconda2\lib\site-packages\conda\activate.py", line 149, in execute
    return getattr(self, self.command)()
  File "D:\Anaconda2\lib\site-packages\conda\activate.py", line 139, in deactivate
    return self._finalize(self._yield_commands(self.build_deactivate()),
  File "D:\Anaconda2\lib\site-packages\conda\activate.py", line 288, in build_deactivate
    old_conda_prefix = os.environ['CONDA_PREFIX']
  File "D:\Anaconda2\lib\os.py", line 425, in __getitem__
    return self.data[key.upper()]
KeyError: u'CONDA_PREFIX'
```


Discussion:

Resolving patch:
diff --git a/conda/activate.py b/conda/activate.py
--- a/conda/activate.py
+++ b/conda/activate.py
@@ -283,7 +283,8 @@ def build_activate(self, env_name_or_prefix):
     def build_deactivate(self):
         # query environment
         old_conda_shlvl = int(os.getenv('CONDA_SHLVL', 0))
-        if old_conda_shlvl <= 0:
+        old_conda_prefix = os.getenv('CONDA_PREFIX', None)
+        if old_conda_shlvl <= 0 or old_conda_prefix is None:
             return {
                 'unset_vars': (),
                 'set_vars': {},
@@ -291,7 +292,6 @@ def build_deactivate(self):
                 'deactivate_scripts': (),
                 'activate_scripts': (),
             }
-        old_conda_prefix = os.environ['CONDA_PREFIX']
         deactivate_scripts = self._get_deactivate_scripts(old_conda_prefix)
 
         new_conda_shlvl = old_conda_shlvl - 1
@@ -548,12 +548,12 @@ def main(argv=None):
     activator_args = argv[2:]
     activator = Activator(shell, activator_args)
     try:
-        sys.stdout.write(activator.execute())
+        print(activator.execute(), end='')
         return 0
     except Exception as e:
         from . import CondaError
         if isinstance(e, CondaError):
-            sys.stderr.write(text_type(e))
+            print(text_type(e), file=sys.stderr)
             return e.return_code
         else:
             raise


Test patch:
Repository: conda/conda

Issue:
conda update --name AssertionError
```
error: AssertionError()
command: /Users/cpthgli/.anyenv/envs/pyenv/versions/default/bin/conda update --name  --all --yes
user_agent: conda/4.4.4 requests/2.18.4 CPython/3.6.4 Darwin/17.3.0 OSX/10.13.2
_messageid: -9223372036843525540
_messagetime: 1514462637935 / 2017-12-28 06:03:57

Traceback (most recent call last):
  File "/Users/cpthgli/.anyenv/envs/pyenv/versions/anaconda3-5.0.1/lib/python3.6/site-packages/conda/exceptions.py", line 724, in __call__
    return func(*args, **kwargs)
  File "/Users/cpthgli/.anyenv/envs/pyenv/versions/anaconda3-5.0.1/lib/python3.6/site-packages/conda/cli/main.py", line 78, in _main
    exit_code = do_call(args, p)
  File "/Users/cpthgli/.anyenv/envs/pyenv/versions/anaconda3-5.0.1/lib/python3.6/site-packages/conda/cli/conda_argparse.py", line 75, in do_call
    exit_code = getattr(module, func_name)(args, parser)
  File "/Users/cpthgli/.anyenv/envs/pyenv/versions/anaconda3-5.0.1/lib/python3.6/site-packages/conda/cli/main_update.py", line 14, in execute
    install(args, parser, 'update')
  File "/Users/cpthgli/.anyenv/envs/pyenv/versions/anaconda3-5.0.1/lib/python3.6/site-packages/conda/cli/install.py", line 140, in install
    prefix = context.target_prefix
  File "/Users/cpthgli/.anyenv/envs/pyenv/versions/anaconda3-5.0.1/lib/python3.6/site-packages/conda/base/context.py", line 454, in target_prefix
    return determine_target_prefix(self)
  File "/Users/cpthgli/.anyenv/envs/pyenv/versions/anaconda3-5.0.1/lib/python3.6/site-packages/conda/base/context.py", line 974, in determine_target_prefix
    return locate_prefix_by_name(prefix_name)
  File "/Users/cpthgli/.anyenv/envs/pyenv/versions/anaconda3-5.0.1/lib/python3.6/site-packages/conda/base/context.py", line 923, in locate_prefix_by_name
    assert name
AssertionError
```


Discussion:

Resolving patch:
diff --git a/conda/base/context.py b/conda/base/context.py
--- a/conda/base/context.py
+++ b/conda/base/context.py
@@ -968,6 +968,14 @@ def determine_target_prefix(ctx, args=None):
     except AttributeError:
         prefix_path = None
 
+    if prefix_name is not None and not prefix_name.strip():  # pragma: no cover
+        from ..exceptions import ArgumentError
+        raise ArgumentError("Argument --name requires a value.")
+
+    if prefix_path is not None and not prefix_path.strip():  # pragma: no cover
+        from ..exceptions import ArgumentError
+        raise ArgumentError("Argument --prefix requires a value.")
+
     if prefix_name is None and prefix_path is None:
         return ctx.default_prefix
     elif prefix_path is not None:


Test patch:
Repository: conda/conda

Issue:
Conda remove doesn't update environments.txt
conda 4.4.6

I'm using `conda remove -p (envPath) --all -y`. The folder gets deleted but the environments.txt file is not updated.




Discussion:

Resolving patch:
diff --git a/conda/cli/main_remove.py b/conda/cli/main_remove.py
--- a/conda/cli/main_remove.py
+++ b/conda/cli/main_remove.py
@@ -11,6 +11,7 @@
 from .install import handle_txn
 from ..base.context import context
 from ..common.compat import iteritems, iterkeys
+from ..core.envs_manager import unregister_env
 from ..core.linked_data import linked_data
 from ..core.solve import Solver
 from ..exceptions import CondaEnvironmentError, CondaValueError
@@ -63,6 +64,7 @@ def execute(args, parser):
         if not context.json:
             confirm_yn()
         rm_rf(prefix)
+        unregister_env(prefix)
 
         if context.json:
             stdout_json({


Test patch:
Repository: conda/conda

Issue:
KeyError with '--update-deps'
```
error: KeyError(True,)
command: /home/jgrnt/miniconda/bin/conda install --update-deps python= numpy nose scipy matplotlib pandas pytest h5py mkl mkl-service
user_agent: conda/4.4.7 requests/2.18.4 CPython/3.6.3 Linux/4.14.4-gentoo gentoo/2.4.1 glibc/2.25
_messageid: -9223372036837525416
_messagetime: 1515513689937 / 2018-01-09 10:01:29

Traceback (most recent call last):
  File "/home/jgrnt/miniconda/lib/python3.6/site-packages/conda/exceptions.py", line 743, in __call__
    return func(*args, **kwargs)
  File "/home/jgrnt/miniconda/lib/python3.6/site-packages/conda/cli/main.py", line 78, in _main
    exit_code = do_call(args, p)
  File "/home/jgrnt/miniconda/lib/python3.6/site-packages/conda/cli/conda_argparse.py", line 76, in do_call
    exit_code = getattr(module, func_name)(args, parser)
  File "/home/jgrnt/miniconda/lib/python3.6/site-packages/conda/cli/main_install.py", line 11, in execute
    install(args, parser, 'install')
  File "/home/jgrnt/miniconda/lib/python3.6/site-packages/conda/cli/install.py", line 236, in install
    force_reinstall=context.force,
  File "/home/jgrnt/miniconda/lib/python3.6/site-packages/conda/core/solve.py", line 504, in solve_for_transaction
    force_remove, force_reinstall)
  File "/home/jgrnt/miniconda/lib/python3.6/site-packages/conda/core/solve.py", line 437, in solve_for_diff
    final_precs = self.solve_final_state(deps_modifier, prune, ignore_pinned, force_remove)
  File "/home/jgrnt/miniconda/lib/python3.6/site-packages/conda/core/solve.py", line 385, in solve_final_state
    for spec in grouped_specs[True])
KeyError: True
```


Discussion:

Resolving patch:
diff --git a/conda/core/solve.py b/conda/core/solve.py
--- a/conda/core/solve.py
+++ b/conda/core/solve.py
@@ -380,9 +380,9 @@ def solve_final_state(self, deps_modifier=NULL, prune=NULL, ignore_pinned=NULL,
                     if ascendant_name not in specs_to_add_names:
                         update_names.add(ascendant_name)
             grouped_specs = groupby(lambda s: s.name in update_names, final_environment_specs)
-            new_final_environment_specs = set(grouped_specs[False])
+            new_final_environment_specs = set(grouped_specs.get(False, ()))
             update_specs = set(MatchSpec(spec.name, optional=spec.optional)
-                               for spec in grouped_specs[True])
+                               for spec in grouped_specs.get(True, ()))
             final_environment_specs = new_final_environment_specs | update_specs
             solution = r.solve(final_environment_specs)
 


Test patch:
Repository: conda/conda

Issue:
--force does NOT imply --no-deps (anymore?)
Using conda 4.4.7, `conda install --force` does not seem to imply `--no-deps`, even so it says in the docstring:

```bash
-f, --force           Force install (even when package already installed),
                        implies --no-deps.
```

Here I try only `--force`:

```bash
(stable) └─❱❱❱ conda install -f hdf5=1.8                                                                                              +8947 16:46 ❰─┘
Solving environment: done

## Package Plan ##

  environment location: /Users/klay6683/miniconda3/envs/stable

  added / updated specs:
    - hdf5=1.8


The following packages will be UPDATED:

    libdap4:   3.18.3-2     conda-forge --> 3.19.2-1             conda-forge
    libpq:     9.6.3-0      conda-forge --> 9.6.6-h77f6c7a_0

The following packages will be DOWNGRADED:

    gdal:      2.2.3-py36_0 conda-forge --> 2.2.2-py36hd505dc6_1
    h5py:      2.7.1-py36_2 conda-forge --> 2.7.1-py36_1         conda-forge
    hdf5:      1.10.1-1     conda-forge --> 1.8.18-2             conda-forge
    kealib:    1.4.7-4      conda-forge --> 1.4.7-3              conda-forge
    libgdal:   2.2.3-2      conda-forge --> 2.2.2-hc3eca24_1
    libnetcdf: 4.4.1.1-10   conda-forge --> 4.4.1.1-9            conda-forge
    netcdf4:   1.3.1-py36_1 conda-forge --> 1.3.1-py36_0         conda-forge
    pytables:  3.4.2-py36_7 conda-forge --> 3.4.2-py36_6         conda-forge
```
As you can see, it tries to downgrade the dependencies.

Using `--no-deps`, things work as expected:

```bash
(stable) └─❱❱❱ conda install --no-deps hdf5=1.8                                                                                       +8949 16:47 ❰─┘
Solving environment: done

## Package Plan ##

  environment location: /Users/klay6683/miniconda3/envs/stable

  added / updated specs:
    - hdf5=1.8


The following packages will be DOWNGRADED:

    hdf5: 1.10.1-1 conda-forge --> 1.8.18-2 conda-forge
```

Running on macOS 10.12.6.


Discussion:
Up through conda 4.3, `--force` has had several different conflated meanings.  We disentangled a lot of that in conda 4.4.  I think there's still more to do though.  The help message there should be updated.

The correct solution now is to use `--no-deps` if you want no-deps, as you've discovered.

Resolving patch:
diff --git a/conda/cli/conda_argparse.py b/conda/cli/conda_argparse.py
--- a/conda/cli/conda_argparse.py
+++ b/conda/cli/conda_argparse.py
@@ -988,8 +988,7 @@ def add_parser_create_install_update(p):
         '-f', "--force",
         action="store_true",
         default=NULL,
-        help="Force install (even when package already installed), "
-               "implies --no-deps.",
+        help="Force install (even when package already installed).",
     )
     add_parser_pscheck(p)
     # Add the file kwarg. We don't use {action="store", nargs='*'} as we don't


Test patch:
Repository: conda/conda

Issue:
Cannot roll back with 'conda install --revision'
```
error: AttributeError("'dict' object has no attribute 'get_pfe'",)
command: C:\Program Files\Anaconda3\Scripts\conda install --revision 4
user_agent: conda/4.4.4 requests/2.18.4 CPython/3.5.2 Windows/8.1 Windows/6.3.9600
_messageid: -9223372036843575560
_messagetime: 1514442489595 / 2017-12-28 00:28:09

Traceback (most recent call last):
  File "C:\Program Files\Anaconda3\lib\site-packages\conda\exceptions.py", line 724, in __call__
    return func(*args, **kwargs)
  File "C:\Program Files\Anaconda3\lib\site-packages\conda\cli\main.py", line 78, in _main
    exit_code = do_call(args, p)
  File "C:\Program Files\Anaconda3\lib\site-packages\conda\cli\conda_argparse.py", line 75, in do_call
    exit_code = getattr(module, func_name)(args, parser)
  File "C:\Program Files\Anaconda3\lib\site-packages\conda\cli\main_install.py", line 11, in execute
    install(args, parser, 'install')
  File "C:\Program Files\Anaconda3\lib\site-packages\conda\cli\install.py", line 232, in install
    progressive_fetch_extract = unlink_link_transaction.get_pfe()
AttributeError: 'dict' object has no attribute 'get_pfe'
```


Discussion:

Resolving patch:
diff --git a/conda/plan.py b/conda/plan.py
--- a/conda/plan.py
+++ b/conda/plan.py
@@ -351,7 +351,6 @@ def revert_actions(prefix, revision=-1, index=None):
     # TODO: If revision raise a revision error, should always go back to a safe revision
     # change
     h = History(prefix)
-    h.update()
     user_requested_specs = itervalues(h.get_requested_specs_map())
     try:
         state = h.get_state(revision)
@@ -360,7 +359,7 @@ def revert_actions(prefix, revision=-1, index=None):
 
     curr = h.get_state()
     if state == curr:
-        return {}  # TODO: return txn with nothing_to_do
+        return UnlinkLinkTransaction()
 
     _supplement_index_with_prefix(index, prefix)
     r = Resolve(index)
@@ -371,11 +370,6 @@ def revert_actions(prefix, revision=-1, index=None):
     link_dists = tuple(d for d in state if not is_linked(prefix, d))
     unlink_dists = set(curr) - set(state)
 
-    # dists = (Dist(s) for s in state)
-    # actions = ensure_linked_actions(dists, prefix)
-    # for dist in curr - state:
-    #     add_unlink(actions, Dist(dist))
-
     # check whether it is a safe revision
     for dist in concatv(link_dists, unlink_dists):
         if dist not in index:


Test patch:
diff --git a/tests/test_create.py b/tests/test_create.py
--- a/tests/test_create.py
+++ b/tests/test_create.py
@@ -1568,6 +1568,7 @@ def test_conda_downgrade(self):
                 stdout, stderr = run_command(Commands.LIST, prefix, "--revisions")
                 print(stdout)
 
+                PrefixData._cache_.clear()
                 run_command(Commands.INSTALL, prefix, "--rev 3")
                 PrefixData._cache_.clear()
                 assert package_is_installed(prefix, "conda-4.3.27")
Repository: conda/conda

Issue:
Sanitize env vars to remove secrets (e.g credentials for PROXY)
For operations like `conda info -a` and error report uploads.


Discussion:

Resolving patch:
diff --git a/conda/cli/main_info.py b/conda/cli/main_info.py
--- a/conda/cli/main_info.py
+++ b/conda/cli/main_info.py
@@ -195,25 +195,29 @@ def get_info_dict(system=False):
         info_dict['UID'] = os.geteuid()
         info_dict['GID'] = os.getegid()
 
-    evars = {
+    env_var_keys = {
         'CIO_TEST',
         'REQUESTS_CA_BUNDLE',
         'SSL_CERT_FILE',
     }
 
     # add all relevant env vars, e.g. startswith('CONDA') or endswith('PATH')
-    evars.update(v for v in os.environ if v.upper().startswith('CONDA'))
-    evars.update(v for v in os.environ if v.upper().startswith('PYTHON'))
-    evars.update(v for v in os.environ if v.upper().endswith('PROXY'))
-    evars.update(v for v in os.environ if v.upper().endswith('PATH'))
-    evars.update(v for v in os.environ if v.upper().startswith('SUDO'))
+    env_var_keys.update(v for v in os.environ if v.upper().startswith('CONDA'))
+    env_var_keys.update(v for v in os.environ if v.upper().startswith('PYTHON'))
+    env_var_keys.update(v for v in os.environ if v.upper().endswith('PATH'))
+    env_var_keys.update(v for v in os.environ if v.upper().startswith('SUDO'))
+
+    env_vars = {ev: os.getenv(ev, os.getenv(ev.lower(), '<not set>')) for ev in env_var_keys}
+
+    proxy_keys = (v for v in os.environ if v.upper().endswith('PROXY'))
+    env_vars.update({ev: '<set>' for ev in proxy_keys})
 
     info_dict.update({
         'sys.version': sys.version,
         'sys.prefix': sys.prefix,
         'sys.executable': sys.executable,
         'site_dirs': get_user_site(),
-        'env_vars': {ev: os.getenv(ev, os.getenv(ev.lower(), '<not set>')) for ev in evars},
+        'env_vars': env_vars,
     })
 
     return info_dict


Test patch:
Repository: conda/conda

Issue:
conda 4.4 sort key prioritizes build string over build number



Discussion:

Resolving patch:
diff --git a/conda/models/index_record.py b/conda/models/index_record.py
--- a/conda/models/index_record.py
+++ b/conda/models/index_record.py
@@ -229,7 +229,8 @@ def schannel(self):
 
     @property
     def _pkey(self):
-        return self.channel.canonical_name, self.subdir, self.name, self.version, self.build
+        return (self.channel.canonical_name, self.subdir, self.name, self.version,
+                self.build_number, self.build)
 
     def __hash__(self):
         return hash(self._pkey)


Test patch:
Repository: conda/conda

Issue:
deprecate 'conda help' in favor of --help CLI flag
With the install on Windows 10:

  _platform : win-64   conda version : 4.3.30
  conda is private : False   conda-env version : 4.3.30
  conda-build version : 3.0.22   python version : 3.6.3.final.0
  requests version : 2.18.4     root environment : C:\Anaconda3  (writable)_

the command:  `conda help install`  (or other similar, say, conda help create, etc.) produces the message

`C:\Anaconda3\python.exe: can't open file 'C:\Anaconda3\Scripts\conda': [Errno 2] No such file or directory`

This syntax works under Linux (Ubuntu), but of course, there is no just "conda" file in Windows Anaconda Scripts.


Discussion:
I also noticed this issue today. It is very annoying, hope it gets solved soon.

```
Current conda install:

               platform : win-64
          conda version : 4.3.30
       conda is private : False
      conda-env version : 4.3.30
    conda-build version : 3.0.27
         python version : 3.6.3.final.0
       requests version : 2.18.4
             user-agent : conda/4.3.30 requests/2.18.4 CPython/3.6.3 Windows/10 Windows/10.0.15063
```

Resolving patch:
diff --git a/conda/cli/main_help.py b/conda/cli/main_help.py
--- a/conda/cli/main_help.py
+++ b/conda/cli/main_help.py
@@ -5,7 +5,6 @@
 # Consult LICENSE.txt or http://opensource.org/licenses/BSD-3-Clause.
 from __future__ import absolute_import, division, print_function, unicode_literals
 
-import subprocess
 import sys
 
 
@@ -13,4 +12,7 @@ def execute(args, parser):
     if not args.command:
         parser.print_help()
         return
-    subprocess.call([sys.executable, sys.argv[0], args.command, '-h'])  # pragma: no cover
+    print("ERROR: The 'conda help' command is deprecated.\n"
+          "Instead use 'conda %s --help'." % args.command,
+          file=sys.stderr)
+    return 1


Test patch:
Repository: conda/conda

Issue:
conda 4.4 can fail to update packages
For example, start with a fresh install of Anaconda3, and then `conda update anaconda-client` doesn't update, even though a new anaconda-client package exists.


Discussion:

Resolving patch:
diff --git a/conda/core/index.py b/conda/core/index.py
--- a/conda/core/index.py
+++ b/conda/core/index.py
@@ -4,7 +4,7 @@
 from itertools import chain
 from logging import getLogger
 
-from .linked_data import linked_data
+from .linked_data import PrefixData, linked_data
 from .package_cache import PackageCache
 from .repodata import SubdirData, make_feature_record
 from .._vendor.boltons.setutils import IndexedSet
@@ -196,12 +196,16 @@ def push_spec(spec):
                         pending_track_features.add(ftr_name)
 
         def push_record(record):
+            push_spec(MatchSpec(record.name))
             for _spec in record.combined_depends:
                 push_spec(_spec)
             if record.track_features:
                 for ftr_name in record.track_features:
                     push_spec(MatchSpec(track_features=ftr_name))
 
+        if prefix:
+            for prefix_rec in PrefixData(prefix).iter_records():
+                push_record(prefix_rec)
         for spec in specs:
             push_spec(spec)
 


Test patch:
diff --git a/tests/test_create.py b/tests/test_create.py
--- a/tests/test_create.py
+++ b/tests/test_create.py
@@ -683,10 +683,22 @@ def test_tarball_install_and_bad_metadata(self):
             assert not package_is_installed(prefix, 'flask', exact=True)
             assert_package_is_installed(prefix, 'flask-0.')
 
+    def test_update_with_pinned_packages(self):
+        # regression test for #6914
+        with make_temp_env("python=2.7.12") as prefix:
+            assert package_is_installed(prefix, "readline-6.2")
+            rm_rf(join(prefix, 'conda-meta', 'history'))
+            PrefixData._cache_.clear()
+            run_command(Commands.UPDATE, prefix, "readline")
+            assert package_is_installed(prefix, "readline")
+            assert not package_is_installed(prefix, "readline-6.2")
+            assert package_is_installed(prefix, "python-2.7")
+            assert not package_is_installed(prefix, "python-2.7.12")
+
     def test_remove_all(self):
-        with make_temp_env("python=2") as prefix:
+        with make_temp_env("python") as prefix:
             assert exists(join(prefix, PYTHON_BINARY))
-            assert_package_is_installed(prefix, 'python-2')
+            assert_package_is_installed(prefix, 'python')
 
             run_command(Commands.REMOVE, prefix, '--all')
             assert not exists(prefix)