# Buggy code
def box(self, instance, val):
    if isinstance(val, string_types):
        val = val.replace("-", "").replace("_", "").lower()
    return super(LinkTypeField, self).box(instance, val)


# Traceback (ValidationError)
An unexpected error has occurred.
Please consider posting the following information to the
conda GitHub issue tracker at:

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



Current conda install:

platform : osx-64
conda version : 4.3.6
conda is private : False
conda-env version : 4.3.6
conda-build version : 1.21.5
python version : 2.7.13.final.0
requests version : 2.12.4
root environment : /Users/mike/anaconda  (writable)
default environment : /Users/mike/anaconda
envs directories : /Users/mike/anaconda/envs
package cache : /Users/mike/anaconda/pkgs
channel URLs : https://conda.anaconda.org/hydrocomputing/osx-64
https://conda.anaconda.org/hydrocomputing/noarch
https://repo.continuum.io/pkgs/free/osx-64
https://repo.continuum.io/pkgs/free/noarch
https://repo.continuum.io/pkgs/r/osx-64
https://repo.continuum.io/pkgs/r/noarch
https://repo.continuum.io/pkgs/pro/osx-64
https://repo.continuum.io/pkgs/pro/noarch
https://conda.anaconda.org/conda-forge/osx-64
https://conda.anaconda.org/conda-forge/noarch
https://conda.anaconda.org/Esri/osx-64
https://conda.anaconda.org/Esri/noarch
config file : /Users/mike/.condarc
offline mode : False
user-agent : conda/4.3.6 requests/2.12.4 CPython/2.7.13 Darwin/15.6.0 OSX/10.11.6
UID:GID : 501:20



`$ /Users/mike/anaconda/bin/conda install numpy`




Traceback (most recent call last):
File "/Users/mike/anaconda/lib/python2.7/site-packages/conda/exceptions.py", line 617, in conda_exception_handler
return_value = func(*args, **kwargs)
File "/Users/mike/anaconda/lib/python2.7/site-packages/conda/cli/main.py", line 137, in _main
exit_code = args.func(args, p)
File "/Users/mike/anaconda/lib/python2.7/site-packages/conda/cli/main_install.py", line 80, in execute
install(args, parser, 'install')
File "/Users/mike/anaconda/lib/python2.7/site-packages/conda/cli/install.py", line 136, in install
linked_dists = install_linked(prefix)
File "/Users/mike/anaconda/lib/python2.7/site-packages/conda/core/linked_data.py", line 121, in linked
return set(linked_data(prefix, ignore_channels=ignore_channels).keys())
File "/Users/mike/anaconda/lib/python2.7/site-packages/conda/core/linked_data.py", line 113, in linked_data
load_linked_data(prefix, dist_name, ignore_channels=ignore_channels)
File "/Users/mike/anaconda/lib/python2.7/site-packages/conda/core/linked_data.py", line 66, in load_linked_data
linked_data_[prefix][dist] = rec = IndexRecord(**rec)
File "/Users/mike/anaconda/lib/python2.7/site-packages/conda/_vendor/auxlib/entity.py", line 702, in __call__
instance = super(EntityType, cls).__call__(*args, **kwargs)
File "/Users/mike/anaconda/lib/python2.7/site-packages/conda/_vendor/auxlib/entity.py", line 719, in __init__
setattr(self, key, kwargs[key])
File "/Users/mike/anaconda/lib/python2.7/site-packages/conda/_vendor/auxlib/entity.py", line 831, in __setattr__
super(ImmutableEntity, self).__setattr__(attribute, value)
File "/Users/mike/anaconda/lib/python2.7/site-packages/conda/_vendor/auxlib/entity.py", line 424, in __set__
instance.__dict__[self.name] = self.validate(instance, self.box(instance, val))
File "/Users/mike/anaconda/lib/python2.7/site-packages/conda/_vendor/auxlib/entity.py", line 658, in box
return val if isinstance(val, self._type) else self._type(**val)
File "/Users/mike/anaconda/lib/python2.7/site-packages/conda/_vendor/auxlib/entity.py", line 702, in __call__
instance = super(EntityType, cls).__call__(*args, **kwargs)
File "/Users/mike/anaconda/lib/python2.7/site-packages/conda/_vendor/auxlib/entity.py", line 719, in __init__
setattr(self, key, kwargs[key])
File "/Users/mike/anaconda/lib/python2.7/site-packages/conda/_vendor/auxlib/entity.py", line 424, in __set__
instance.__dict__[self.name] = self.validate(instance, self.box(instance, val))
File "/Users/mike/anaconda/lib/python2.7/site-packages/conda/models/index_record.py", line 15, in box
return super(LinkTypeField, self).box(instance, val)
File "/Users/mike/anaconda/lib/python2.7/site-packages/conda/_vendor/auxlib/entity.py", line 557, in box
raise ValidationError(val, msg=e1)
ValidationError: hard is not a valid LinkType

# Fixed code
def box(self, instance, val):
    if isinstance(val, string_types):
        val = val.replace("-", "").replace("_", "").lower()
        if val == "hard":
            val = LinkType.hardlink
        elif val == "soft":
            val = LinkType.softlink
    return super(LinkTypeField, self).box(instance, val)