We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
An unexpected error has occurred.
Current conda install:

               platform : win-64
          conda version : 4.3.11
       conda is private : False
      conda-env version : 4.3.11
    conda-build version : 2.0.2
         python version : 2.7.12.final.0
       requests version : 2.13.0
       root environment : I:\Program Files\Anaconda2  (writable)
    default environment : I:\Program Files\Anaconda2
       envs directories : I:\Program Files\Anaconda2\envs
                          C:\Users\topnet\AppData\Local\conda\conda\envs
                          C:\Users\topnet\.conda\envs
          package cache : I:\Program Files\Anaconda2\pkgs
                          C:\Users\topnet\AppData\Local\conda\conda\pkgs
           channel URLs : https://conda.anaconda.org/conda-forge/win-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64
                          https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/free/win-64
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/r/win-64
                          https://repo.continuum.io/pkgs/r/noarch
                          https://repo.continuum.io/pkgs/pro/win-64
                          https://repo.continuum.io/pkgs/pro/noarch
                          https://repo.continuum.io/pkgs/msys2/win-64
                          https://repo.continuum.io/pkgs/msys2/noarch
            config file : C:\Users\topnet\.condarc
           offline mode : False
             user-agent : conda/4.3.11 requests/2.13.0 CPython/2.7.12 Windows/10 Windows/10.0.14393



`$ I:\Program Files\Anaconda2\Scripts\conda-script.py install numpy`




    Traceback (most recent call last):
      File "I:\Program Files\Anaconda2\lib\site-packages\conda\exceptions.py", line 616, in conda_exception_handler
        return_value = func(*args, **kwargs)
      File "I:\Program Files\Anaconda2\lib\site-packages\conda\cli\main.py", line 137, in _main
        exit_code = args.func(args, p)
      File "I:\Program Files\Anaconda2\lib\site-packages\conda\cli\main_install.py", line 80, in execute
        install(args, parser, 'install')
      File "I:\Program Files\Anaconda2\lib\site-packages\conda\cli\install.py", line 359, in install
        execute_actions(actions, index, verbose=not context.quiet)
      File "I:\Program Files\Anaconda2\lib\site-packages\conda\plan.py", line 825, in execute_actions
        execute_instructions(plan, index, verbose)
      File "I:\Program Files\Anaconda2\lib\site-packages\conda\instructions.py", line 258, in execute_instructions
        cmd(state, arg)
      File "I:\Program Files\Anaconda2\lib\site-packages\conda\instructions.py", line 111, in PROGRESSIVEFETCHEXTRACT_CMD
        progressive_fetch_extract.execute()
      File "I:\Program Files\Anaconda2\lib\site-packages\conda\core\package_cache.py", line 470, in execute
        self._execute_action(action)
      File "I:\Program Files\Anaconda2\lib\site-packages\conda\core\package_cache.py", line 486, in _execute_action
        exceptions.append(CondaError(repr(e)))
      File "I:\Program Files\Anaconda2\lib\site-packages\conda\__init__.py", line 43, in __repr__
        return '%s: %s\n' % (self.__class__.__name__, text_type(self))
      File "I:\Program Files\Anaconda2\lib\site-packages\conda\__init__.py", line 46, in __str__
        return text_type(self.message % self._kwargs)
    TypeError: not enough arguments for format string

thanks！

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `conda/__init__.py`
Content:
```
1 # (c) 2012-2016 Continuum Analytics, Inc. / http://continuum.io
2 # All Rights Reserved
3 #
4 # conda is distributed under the terms of the BSD 3-clause license.
5 # Consult LICENSE.txt or http://opensource.org/licenses/BSD-3-Clause.
6 """OS-agnostic, system-level binary package manager."""
7 from __future__ import absolute_import, division, print_function, unicode_literals
8 
9 import os
10 from os.path import dirname
11 import sys
12 
13 from ._vendor.auxlib.packaging import get_version
14 from .common.compat import iteritems, text_type
15 
16 __all__ = (
17     "__name__", "__version__", "__author__", "__email__", "__license__", "__summary__", "__url__",
18     "CONDA_PACKAGE_ROOT", "CondaError", "CondaMultiError", "CondaExitZero", "conda_signal_handler",
19 )
20 
21 __name__ = "conda"
22 __version__ = get_version(__file__)
23 __author__ = "Continuum Analytics, Inc."
24 __email__ = "conda@continuum.io"
25 __license__ = "BSD"
26 __summary__ = __doc__
27 __url__ = "https://github.com/conda/conda"
28 
29 
30 if os.getenv('CONDA_ROOT') is None:
31     os.environ[str('CONDA_ROOT')] = sys.prefix
32 
33 CONDA_PACKAGE_ROOT = dirname(__file__)
34 
35 
36 class CondaError(Exception):
37     def __init__(self, message, caused_by=None, **kwargs):
38         self.message = message
39         self._kwargs = kwargs
40         self._caused_by = caused_by
41         super(CondaError, self).__init__(message)
42 
43     def __repr__(self):
44         return '%s: %s' % (self.__class__.__name__, text_type(self))
45 
46     def __str__(self):
47         return text_type(self.message % self._kwargs)
48 
49     def dump_map(self):
50         result = dict((k, v) for k, v in iteritems(vars(self)) if not k.startswith('_'))
51         result.update(exception_type=text_type(type(self)),
52                       exception_name=self.__class__.__name__,
53                       message=text_type(self),
54                       error=repr(self),
55                       caused_by=repr(self._caused_by),
56                       **self._kwargs)
57         return result
58 
59 
60 class CondaMultiError(CondaError):
61 
62     def __init__(self, errors):
63         self.errors = errors
64         super(CondaError, self).__init__(None)
65 
66     def __repr__(self):
67         return '\n'.join(repr(e) for e in self.errors) + '\n'
68 
69     def __str__(self):
70         return '\n'.join(text_type(e) for e in self.errors) + '\n'
71 
72     def dump_map(self):
73         return dict(exception_type=text_type(type(self)),
74                     exception_name=self.__class__.__name__,
75                     errors=tuple(error.dump_map() for error in self.errors),
76                     error="Multiple Errors Encountered.",
77                     )
78 
79 
80 class CondaExitZero(CondaError):
81     pass
82 
83 
84 ACTIVE_SUBPROCESSES = set()
85 
86 
87 def conda_signal_handler(signum, frame):
88     # This function is in the base __init__.py so that it can be monkey-patched by other code
89     #   if downstream conda users so choose.  The biggest danger of monkey-patching is that
90     #   unlink/link transactions don't get rolled back if interrupted mid-transaction.
91     for p in ACTIVE_SUBPROCESSES:
92         if p.poll() is None:
93             p.send_signal(signum)
94 
95     from .exceptions import CondaSignalInterrupt
96     raise CondaSignalInterrupt(signum)
97
```
--- 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()

```

diff --git a/conda/__init__.py b/conda/__init__.py
--- a/conda/__init__.py
+++ b/conda/__init__.py
@@ -44,7 +44,19 @@
         return '%s: %s' % (self.__class__.__name__, text_type(self))
 
     def __str__(self):
-        return text_type(self.message % self._kwargs)
+        try:
+            return text_type(self.message % self._kwargs)
+        except TypeError:
+            # TypeError: not enough arguments for format string
+            debug_message = "\n".join((
+                "class: " + self.__class__.__name__,
+                "message:",
+                self.message,
+                "kwargs:",
+                text_type(self._kwargs),
+            ))
+            sys.stderr.write(debug_message)
+            raise
 
     def dump_map(self):
         result = dict((k, v) for k, v in iteritems(vars(self)) if not k.startswith('_'))

{"golden_diff": "diff --git a/conda/__init__.py b/conda/__init__.py\n--- a/conda/__init__.py\n+++ b/conda/__init__.py\n@@ -44,7 +44,19 @@\n         return '%s: %s' % (self.__class__.__name__, text_type(self))\n \n     def __str__(self):\n-        return text_type(self.message % self._kwargs)\n+        try:\n+            return text_type(self.message % self._kwargs)\n+        except TypeError:\n+            # TypeError: not enough arguments for format string\n+            debug_message = \"\\n\".join((\n+                \"class: \" + self.__class__.__name__,\n+                \"message:\",\n+                self.message,\n+                \"kwargs:\",\n+                text_type(self._kwargs),\n+            ))\n+            sys.stderr.write(debug_message)\n+            raise\n \n     def dump_map(self):\n         result = dict((k, v) for k, v in iteritems(vars(self)) if not k.startswith('_'))\n", "issue": "An unexpected error has occurred.\nCurrent conda install:\r\n\r\n               platform : win-64\r\n          conda version : 4.3.11\r\n       conda is private : False\r\n      conda-env version : 4.3.11\r\n    conda-build version : 2.0.2\r\n         python version : 2.7.12.final.0\r\n       requests version : 2.13.0\r\n       root environment : I:\\Program Files\\Anaconda2  (writable)\r\n    default environment : I:\\Program Files\\Anaconda2\r\n       envs directories : I:\\Program Files\\Anaconda2\\envs\r\n                          C:\\Users\\topnet\\AppData\\Local\\conda\\conda\\envs\r\n                          C:\\Users\\topnet\\.conda\\envs\r\n          package cache : I:\\Program Files\\Anaconda2\\pkgs\r\n                          C:\\Users\\topnet\\AppData\\Local\\conda\\conda\\pkgs\r\n           channel URLs : https://conda.anaconda.org/conda-forge/win-64\r\n                          https://conda.anaconda.org/conda-forge/noarch\r\n                          https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64\r\n                          https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/noarch\r\n                          https://repo.continuum.io/pkgs/free/win-64\r\n                          https://repo.continuum.io/pkgs/free/noarch\r\n                          https://repo.continuum.io/pkgs/r/win-64\r\n                          https://repo.continuum.io/pkgs/r/noarch\r\n                          https://repo.continuum.io/pkgs/pro/win-64\r\n                          https://repo.continuum.io/pkgs/pro/noarch\r\n                          https://repo.continuum.io/pkgs/msys2/win-64\r\n                          https://repo.continuum.io/pkgs/msys2/noarch\r\n            config file : C:\\Users\\topnet\\.condarc\r\n           offline mode : False\r\n             user-agent : conda/4.3.11 requests/2.13.0 CPython/2.7.12 Windows/10 Windows/10.0.14393\r\n\r\n\r\n\r\n`$ I:\\Program Files\\Anaconda2\\Scripts\\conda-script.py install numpy`\r\n\r\n\r\n\r\n\r\n    Traceback (most recent call last):\r\n      File \"I:\\Program Files\\Anaconda2\\lib\\site-packages\\conda\\exceptions.py\", line 616, in conda_exception_handler\r\n        return_value = func(*args, **kwargs)\r\n      File \"I:\\Program Files\\Anaconda2\\lib\\site-packages\\conda\\cli\\main.py\", line 137, in _main\r\n        exit_code = args.func(args, p)\r\n      File \"I:\\Program Files\\Anaconda2\\lib\\site-packages\\conda\\cli\\main_install.py\", line 80, in execute\r\n        install(args, parser, 'install')\r\n      File \"I:\\Program Files\\Anaconda2\\lib\\site-packages\\conda\\cli\\install.py\", line 359, in install\r\n        execute_actions(actions, index, verbose=not context.quiet)\r\n      File \"I:\\Program Files\\Anaconda2\\lib\\site-packages\\conda\\plan.py\", line 825, in execute_actions\r\n        execute_instructions(plan, index, verbose)\r\n      File \"I:\\Program Files\\Anaconda2\\lib\\site-packages\\conda\\instructions.py\", line 258, in execute_instructions\r\n        cmd(state, arg)\r\n      File \"I:\\Program Files\\Anaconda2\\lib\\site-packages\\conda\\instructions.py\", line 111, in PROGRESSIVEFETCHEXTRACT_CMD\r\n        progressive_fetch_extract.execute()\r\n      File \"I:\\Program Files\\Anaconda2\\lib\\site-packages\\conda\\core\\package_cache.py\", line 470, in execute\r\n        self._execute_action(action)\r\n      File \"I:\\Program Files\\Anaconda2\\lib\\site-packages\\conda\\core\\package_cache.py\", line 486, in _execute_action\r\n        exceptions.append(CondaError(repr(e)))\r\n      File \"I:\\Program Files\\Anaconda2\\lib\\site-packages\\conda\\__init__.py\", line 43, in __repr__\r\n        return '%s: %s\\n' % (self.__class__.__name__, text_type(self))\r\n      File \"I:\\Program Files\\Anaconda2\\lib\\site-packages\\conda\\__init__.py\", line 46, in __str__\r\n        return text_type(self.message % self._kwargs)\r\n    TypeError: not enough arguments for format string\r\n\r\nthanks\uff01\n", "before_files": [{"content": "# (c) 2012-2016 Continuum Analytics, Inc. / http://continuum.io\n# All Rights Reserved\n#\n# conda is distributed under the terms of the BSD 3-clause license.\n# Consult LICENSE.txt or http://opensource.org/licenses/BSD-3-Clause.\n\"\"\"OS-agnostic, system-level binary package manager.\"\"\"\nfrom __future__ import absolute_import, division, print_function, unicode_literals\n\nimport os\nfrom os.path import dirname\nimport sys\n\nfrom ._vendor.auxlib.packaging import get_version\nfrom .common.compat import iteritems, text_type\n\n__all__ = (\n    \"__name__\", \"__version__\", \"__author__\", \"__email__\", \"__license__\", \"__summary__\", \"__url__\",\n    \"CONDA_PACKAGE_ROOT\", \"CondaError\", \"CondaMultiError\", \"CondaExitZero\", \"conda_signal_handler\",\n)\n\n__name__ = \"conda\"\n__version__ = get_version(__file__)\n__author__ = \"Continuum Analytics, Inc.\"\n__email__ = \"conda@continuum.io\"\n__license__ = \"BSD\"\n__summary__ = __doc__\n__url__ = \"https://github.com/conda/conda\"\n\n\nif os.getenv('CONDA_ROOT') is None:\n    os.environ[str('CONDA_ROOT')] = sys.prefix\n\nCONDA_PACKAGE_ROOT = dirname(__file__)\n\n\nclass CondaError(Exception):\n    def __init__(self, message, caused_by=None, **kwargs):\n        self.message = message\n        self._kwargs = kwargs\n        self._caused_by = caused_by\n        super(CondaError, self).__init__(message)\n\n    def __repr__(self):\n        return '%s: %s' % (self.__class__.__name__, text_type(self))\n\n    def __str__(self):\n        return text_type(self.message % self._kwargs)\n\n    def dump_map(self):\n        result = dict((k, v) for k, v in iteritems(vars(self)) if not k.startswith('_'))\n        result.update(exception_type=text_type(type(self)),\n                      exception_name=self.__class__.__name__,\n                      message=text_type(self),\n                      error=repr(self),\n                      caused_by=repr(self._caused_by),\n                      **self._kwargs)\n        return result\n\n\nclass CondaMultiError(CondaError):\n\n    def __init__(self, errors):\n        self.errors = errors\n        super(CondaError, self).__init__(None)\n\n    def __repr__(self):\n        return '\\n'.join(repr(e) for e in self.errors) + '\\n'\n\n    def __str__(self):\n        return '\\n'.join(text_type(e) for e in self.errors) + '\\n'\n\n    def dump_map(self):\n        return dict(exception_type=text_type(type(self)),\n                    exception_name=self.__class__.__name__,\n                    errors=tuple(error.dump_map() for error in self.errors),\n                    error=\"Multiple Errors Encountered.\",\n                    )\n\n\nclass CondaExitZero(CondaError):\n    pass\n\n\nACTIVE_SUBPROCESSES = set()\n\n\ndef conda_signal_handler(signum, frame):\n    # This function is in the base __init__.py so that it can be monkey-patched by other code\n    #   if downstream conda users so choose.  The biggest danger of monkey-patching is that\n    #   unlink/link transactions don't get rolled back if interrupted mid-transaction.\n    for p in ACTIVE_SUBPROCESSES:\n        if p.poll() is None:\n            p.send_signal(signum)\n\n    from .exceptions import CondaSignalInterrupt\n    raise CondaSignalInterrupt(signum)\n", "path": "conda/__init__.py"}], "after_files": [{"content": "# (c) 2012-2016 Continuum Analytics, Inc. / http://continuum.io\n# All Rights Reserved\n#\n# conda is distributed under the terms of the BSD 3-clause license.\n# Consult LICENSE.txt or http://opensource.org/licenses/BSD-3-Clause.\n\"\"\"OS-agnostic, system-level binary package manager.\"\"\"\nfrom __future__ import absolute_import, division, print_function, unicode_literals\n\nimport os\nfrom os.path import dirname\nimport sys\n\nfrom ._vendor.auxlib.packaging import get_version\nfrom .common.compat import iteritems, text_type\n\n__all__ = (\n    \"__name__\", \"__version__\", \"__author__\", \"__email__\", \"__license__\", \"__summary__\", \"__url__\",\n    \"CONDA_PACKAGE_ROOT\", \"CondaError\", \"CondaMultiError\", \"CondaExitZero\", \"conda_signal_handler\",\n)\n\n__name__ = \"conda\"\n__version__ = get_version(__file__)\n__author__ = \"Continuum Analytics, Inc.\"\n__email__ = \"conda@continuum.io\"\n__license__ = \"BSD\"\n__summary__ = __doc__\n__url__ = \"https://github.com/conda/conda\"\n\n\nif os.getenv('CONDA_ROOT') is None:\n    os.environ[str('CONDA_ROOT')] = sys.prefix\n\nCONDA_PACKAGE_ROOT = dirname(__file__)\n\n\nclass CondaError(Exception):\n    def __init__(self, message, caused_by=None, **kwargs):\n        self.message = message\n        self._kwargs = kwargs\n        self._caused_by = caused_by\n        super(CondaError, self).__init__(message)\n\n    def __repr__(self):\n        return '%s: %s' % (self.__class__.__name__, text_type(self))\n\n    def __str__(self):\n        try:\n            return text_type(self.message % self._kwargs)\n        except TypeError:\n            # TypeError: not enough arguments for format string\n            debug_message = \"\\n\".join((\n                \"class: \" + self.__class__.__name__,\n                \"message:\",\n                self.message,\n                \"kwargs:\",\n                text_type(self._kwargs),\n            ))\n            sys.stderr.write(debug_message)\n            raise\n\n    def dump_map(self):\n        result = dict((k, v) for k, v in iteritems(vars(self)) if not k.startswith('_'))\n        result.update(exception_type=text_type(type(self)),\n                      exception_name=self.__class__.__name__,\n                      message=text_type(self),\n                      error=repr(self),\n                      caused_by=repr(self._caused_by),\n                      **self._kwargs)\n        return result\n\n\nclass CondaMultiError(CondaError):\n\n    def __init__(self, errors):\n        self.errors = errors\n        super(CondaError, self).__init__(None)\n\n    def __repr__(self):\n        return '\\n'.join(repr(e) for e in self.errors) + '\\n'\n\n    def __str__(self):\n        return '\\n'.join(text_type(e) for e in self.errors) + '\\n'\n\n    def dump_map(self):\n        return dict(exception_type=text_type(type(self)),\n                    exception_name=self.__class__.__name__,\n                    errors=tuple(error.dump_map() for error in self.errors),\n                    error=\"Multiple Errors Encountered.\",\n                    )\n\n\nclass CondaExitZero(CondaError):\n    pass\n\n\nACTIVE_SUBPROCESSES = set()\n\n\ndef conda_signal_handler(signum, frame):\n    # This function is in the base __init__.py so that it can be monkey-patched by other code\n    #   if downstream conda users so choose.  The biggest danger of monkey-patching is that\n    #   unlink/link transactions don't get rolled back if interrupted mid-transaction.\n    for p in ACTIVE_SUBPROCESSES:\n        if p.poll() is None:\n            p.send_signal(signum)\n\n    from .exceptions import CondaSignalInterrupt\n    raise CondaSignalInterrupt(signum)\n", "path": "conda/__init__.py"}]}