prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  conan search gives AttributeError: 'UserIO' object has no attribute 'warn'
  Version: 1.1.1
  OS: Linux Ubuntu 14.04 
  conda: v4.2.7
  
  Repro steps:
  * `conda create -n conan python=2.7`
  * `source activate conan`
  * `pip install conan`
  * `conan search zlib/1.2.11@conan/stable -r=conan-center`
  
  Gives the following python stack:
  
  ```
  (conan) ~ $ conan search zlib/1.2.11@conan/stable -r=conan-center
  Traceback (most recent call last):
    File "/home/mgodbolt/apps/miniconda/envs/conan/lib/python2.7/site-packages/conans/client/command.py", line 1131, in run
      method(args[0][1:])
    File "/home/mgodbolt/apps/miniconda/envs/conan/lib/python2.7/site-packages/conans/client/command.py", line 814, in search
      outdated=args.outdated)
    File "/home/mgodbolt/apps/miniconda/envs/conan/lib/python2.7/site-packages/conans/client/conan_api.py", line 64, in wrapper
      return f(*args, **kwargs)
    File "/home/mgodbolt/apps/miniconda/envs/conan/lib/python2.7/site-packages/conans/client/conan_api.py", line 595, in search_packages
      outdated=outdated)
    File "/home/mgodbolt/apps/miniconda/envs/conan/lib/python2.7/site-packages/conans/client/cmd/search.py", line 44, in search_packages
      remote = RemoteRegistry(self._client_cache.registry, self._user_io).remote(remote)
    File "/home/mgodbolt/apps/miniconda/envs/conan/lib/python2.7/site-packages/conans/client/remote_registry.py", line 95, in remote
      remotes, _ = self._load()
    File "/home/mgodbolt/apps/miniconda/envs/conan/lib/python2.7/site-packages/conans/client/remote_registry.py", line 65, in _load
      self._output.warn("Remotes registry file missing, creating default one in %s"
  AttributeError: 'UserIO' object has no attribute 'warn'
  
  ERROR: 'UserIO' object has no attribute 'warn'
  ```
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `conans/client/cmd/search.py`
  Content:
  ```
  1 from conans.search.search import DiskSearchManager, filter_outdated
  2 from collections import OrderedDict
  3 from conans.client.remote_registry import RemoteRegistry
  4 
  5 
  6 class Search(object):
  7     def __init__(self, client_cache, remote_manager, user_io):
  8         self._client_cache = client_cache
  9         self._remote_manager = remote_manager
  10         self._user_io = user_io
  11 
  12     def search_recipes(self, pattern, remote=None, case_sensitive=False):
  13         ignorecase = not case_sensitive
  14         if not remote:
  15             return DiskSearchManager(self._client_cache).search_recipes(pattern, ignorecase)
  16 
  17         registry = RemoteRegistry(self._client_cache.registry, self._user_io.out)
  18         if remote == 'all':
  19             remotes = registry.remotes
  20             # We have to check if there is a remote called "all"
  21             # Deprecate: 2.0 can remove this check
  22             if 'all' not in (r.name for r in remotes):
  23                 references = {}
  24                 for remote in remotes:
  25                     result = self._remote_manager.search_recipes(remote, pattern, ignorecase)
  26                     if result:
  27                         references[remote.name] = result
  28                 return references
  29         # single remote
  30         remote = registry.remote(remote)
  31         return self._remote_manager.search_recipes(remote, pattern, ignorecase)
  32 
  33     def search_packages(self, reference=None, remote=None, query=None, outdated=False):
  34         """ Return the single information saved in conan.vars about all the packages
  35             or the packages which match with a pattern
  36 
  37             Attributes:
  38                 pattern = string to match packages
  39                 remote = search on another origin to get packages info
  40                 packages_pattern = String query with binary
  41                                    packages properties: "arch=x86 AND os=Windows"
  42         """
  43         if remote:
  44             remote = RemoteRegistry(self._client_cache.registry, self._user_io).remote(remote)
  45             packages_props = self._remote_manager.search_packages(remote, reference, query)
  46             ordered_packages = OrderedDict(sorted(packages_props.items()))
  47             manifest = self._remote_manager.get_conan_digest(reference, remote)
  48             recipe_hash = manifest.summary_hash
  49         else:
  50             searcher = DiskSearchManager(self._client_cache)
  51             packages_props = searcher.search_packages(reference, query)
  52             ordered_packages = OrderedDict(sorted(packages_props.items()))
  53             try:
  54                 recipe_hash = self._client_cache.load_manifest(reference).summary_hash
  55             except IOError:  # It could not exist in local
  56                 recipe_hash = None
  57         if outdated and recipe_hash:
  58             ordered_packages = filter_outdated(ordered_packages, recipe_hash)
  59         return ordered_packages, reference, recipe_hash, query
  60
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/conans/client/cmd/search.py b/conans/client/cmd/search.py
  --- a/conans/client/cmd/search.py
  +++ b/conans/client/cmd/search.py
  @@ -41,7 +41,7 @@
                                      packages properties: "arch=x86 AND os=Windows"
           """
           if remote:
  -            remote = RemoteRegistry(self._client_cache.registry, self._user_io).remote(remote)
  +            remote = RemoteRegistry(self._client_cache.registry, self._user_io.out).remote(remote)
               packages_props = self._remote_manager.search_packages(remote, reference, query)
               ordered_packages = OrderedDict(sorted(packages_props.items()))
               manifest = self._remote_manager.get_conan_digest(reference, remote)
  
verification_info: {"golden_diff": "diff --git a/conans/client/cmd/search.py b/conans/client/cmd/search.py\n--- a/conans/client/cmd/search.py\n+++ b/conans/client/cmd/search.py\n@@ -41,7 +41,7 @@\n                                    packages properties: \"arch=x86 AND os=Windows\"\n         \"\"\"\n         if remote:\n-            remote = RemoteRegistry(self._client_cache.registry, self._user_io).remote(remote)\n+            remote = RemoteRegistry(self._client_cache.registry, self._user_io.out).remote(remote)\n             packages_props = self._remote_manager.search_packages(remote, reference, query)\n             ordered_packages = OrderedDict(sorted(packages_props.items()))\n             manifest = self._remote_manager.get_conan_digest(reference, remote)\n", "issue": "conan search gives AttributeError: 'UserIO' object has no attribute 'warn'\nVersion: 1.1.1\r\nOS: Linux Ubuntu 14.04 \r\nconda: v4.2.7\r\n\r\nRepro steps:\r\n* `conda create -n conan python=2.7`\r\n* `source activate conan`\r\n* `pip install conan`\r\n* `conan search zlib/1.2.11@conan/stable -r=conan-center`\r\n\r\nGives the following python stack:\r\n\r\n```\r\n(conan) ~ $ conan search zlib/1.2.11@conan/stable -r=conan-center\r\nTraceback (most recent call last):\r\n  File \"/home/mgodbolt/apps/miniconda/envs/conan/lib/python2.7/site-packages/conans/client/command.py\", line 1131, in run\r\n    method(args[0][1:])\r\n  File \"/home/mgodbolt/apps/miniconda/envs/conan/lib/python2.7/site-packages/conans/client/command.py\", line 814, in search\r\n    outdated=args.outdated)\r\n  File \"/home/mgodbolt/apps/miniconda/envs/conan/lib/python2.7/site-packages/conans/client/conan_api.py\", line 64, in wrapper\r\n    return f(*args, **kwargs)\r\n  File \"/home/mgodbolt/apps/miniconda/envs/conan/lib/python2.7/site-packages/conans/client/conan_api.py\", line 595, in search_packages\r\n    outdated=outdated)\r\n  File \"/home/mgodbolt/apps/miniconda/envs/conan/lib/python2.7/site-packages/conans/client/cmd/search.py\", line 44, in search_packages\r\n    remote = RemoteRegistry(self._client_cache.registry, self._user_io).remote(remote)\r\n  File \"/home/mgodbolt/apps/miniconda/envs/conan/lib/python2.7/site-packages/conans/client/remote_registry.py\", line 95, in remote\r\n    remotes, _ = self._load()\r\n  File \"/home/mgodbolt/apps/miniconda/envs/conan/lib/python2.7/site-packages/conans/client/remote_registry.py\", line 65, in _load\r\n    self._output.warn(\"Remotes registry file missing, creating default one in %s\"\r\nAttributeError: 'UserIO' object has no attribute 'warn'\r\n\r\nERROR: 'UserIO' object has no attribute 'warn'\r\n```\r\n\n", "before_files": [{"content": "from conans.search.search import DiskSearchManager, filter_outdated\nfrom collections import OrderedDict\nfrom conans.client.remote_registry import RemoteRegistry\n\n\nclass Search(object):\n    def __init__(self, client_cache, remote_manager, user_io):\n        self._client_cache = client_cache\n        self._remote_manager = remote_manager\n        self._user_io = user_io\n\n    def search_recipes(self, pattern, remote=None, case_sensitive=False):\n        ignorecase = not case_sensitive\n        if not remote:\n            return DiskSearchManager(self._client_cache).search_recipes(pattern, ignorecase)\n\n        registry = RemoteRegistry(self._client_cache.registry, self._user_io.out)\n        if remote == 'all':\n            remotes = registry.remotes\n            # We have to check if there is a remote called \"all\"\n            # Deprecate: 2.0 can remove this check\n            if 'all' not in (r.name for r in remotes):\n                references = {}\n                for remote in remotes:\n                    result = self._remote_manager.search_recipes(remote, pattern, ignorecase)\n                    if result:\n                        references[remote.name] = result\n                return references\n        # single remote\n        remote = registry.remote(remote)\n        return self._remote_manager.search_recipes(remote, pattern, ignorecase)\n\n    def search_packages(self, reference=None, remote=None, query=None, outdated=False):\n        \"\"\" Return the single information saved in conan.vars about all the packages\n            or the packages which match with a pattern\n\n            Attributes:\n                pattern = string to match packages\n                remote = search on another origin to get packages info\n                packages_pattern = String query with binary\n                                   packages properties: \"arch=x86 AND os=Windows\"\n        \"\"\"\n        if remote:\n            remote = RemoteRegistry(self._client_cache.registry, self._user_io).remote(remote)\n            packages_props = self._remote_manager.search_packages(remote, reference, query)\n            ordered_packages = OrderedDict(sorted(packages_props.items()))\n            manifest = self._remote_manager.get_conan_digest(reference, remote)\n            recipe_hash = manifest.summary_hash\n        else:\n            searcher = DiskSearchManager(self._client_cache)\n            packages_props = searcher.search_packages(reference, query)\n            ordered_packages = OrderedDict(sorted(packages_props.items()))\n            try:\n                recipe_hash = self._client_cache.load_manifest(reference).summary_hash\n            except IOError:  # It could not exist in local\n                recipe_hash = None\n        if outdated and recipe_hash:\n            ordered_packages = filter_outdated(ordered_packages, recipe_hash)\n        return ordered_packages, reference, recipe_hash, query\n", "path": "conans/client/cmd/search.py"}], "after_files": [{"content": "from conans.search.search import DiskSearchManager, filter_outdated\nfrom collections import OrderedDict\nfrom conans.client.remote_registry import RemoteRegistry\n\n\nclass Search(object):\n    def __init__(self, client_cache, remote_manager, user_io):\n        self._client_cache = client_cache\n        self._remote_manager = remote_manager\n        self._user_io = user_io\n\n    def search_recipes(self, pattern, remote=None, case_sensitive=False):\n        ignorecase = not case_sensitive\n        if not remote:\n            return DiskSearchManager(self._client_cache).search_recipes(pattern, ignorecase)\n\n        registry = RemoteRegistry(self._client_cache.registry, self._user_io.out)\n        if remote == 'all':\n            remotes = registry.remotes\n            # We have to check if there is a remote called \"all\"\n            # Deprecate: 2.0 can remove this check\n            if 'all' not in (r.name for r in remotes):\n                references = {}\n                for remote in remotes:\n                    result = self._remote_manager.search_recipes(remote, pattern, ignorecase)\n                    if result:\n                        references[remote.name] = result\n                return references\n        # single remote\n        remote = registry.remote(remote)\n        return self._remote_manager.search_recipes(remote, pattern, ignorecase)\n\n    def search_packages(self, reference=None, remote=None, query=None, outdated=False):\n        \"\"\" Return the single information saved in conan.vars about all the packages\n            or the packages which match with a pattern\n\n            Attributes:\n                pattern = string to match packages\n                remote = search on another origin to get packages info\n                packages_pattern = String query with binary\n                                   packages properties: \"arch=x86 AND os=Windows\"\n        \"\"\"\n        if remote:\n            remote = RemoteRegistry(self._client_cache.registry, self._user_io.out).remote(remote)\n            packages_props = self._remote_manager.search_packages(remote, reference, query)\n            ordered_packages = OrderedDict(sorted(packages_props.items()))\n            manifest = self._remote_manager.get_conan_digest(reference, remote)\n            recipe_hash = manifest.summary_hash\n        else:\n            searcher = DiskSearchManager(self._client_cache)\n            packages_props = searcher.search_packages(reference, query)\n            ordered_packages = OrderedDict(sorted(packages_props.items()))\n            try:\n                recipe_hash = self._client_cache.load_manifest(reference).summary_hash\n            except IOError:  # It could not exist in local\n                recipe_hash = None\n        if outdated and recipe_hash:\n            ordered_packages = filter_outdated(ordered_packages, recipe_hash)\n        return ordered_packages, reference, recipe_hash, query\n", "path": "conans/client/cmd/search.py"}]}