We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
returned non-string (type Error)
Hey there, I installed certbot as per the doc's from letsencrypt on Debian Jessie and certbot in manual mode returns:

certbot certonly --manual -d mydomain.com

```
An unexpected error occurred:
TypeError: __str__ returned non-string (type Error)
```

```
pip2 list
acme (0.9.3)
...
certbot (0.9.3)
cryptography (1.5.3)
...
pyOpenSSL (16.0.0)
```

Anyone seen this before and can offer a solution? 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: `acme/setup.py`
Content:
```
1 import sys
2 
3 from setuptools import setup
4 from setuptools import find_packages
5 
6 
7 version = '0.12.0.dev0'
8 
9 # Please update tox.ini when modifying dependency version requirements
10 install_requires = [
11     # load_pem_private/public_key (>=0.6)
12     # rsa_recover_prime_factors (>=0.8)
13     'cryptography>=0.8',
14     # Connection.set_tlsext_host_name (>=0.13)
15     'PyOpenSSL>=0.13',
16     'pyrfc3339',
17     'pytz',
18     'requests[security]>=2.4.1',  # security extras added in 2.4.1
19     # For pkg_resources. >=1.0 so pip resolves it to a version cryptography
20     # will tolerate; see #2599:
21     'setuptools>=1.0',
22     'six',
23 ]
24 
25 # env markers in extras_require cause problems with older pip: #517
26 # Keep in sync with conditional_requirements.py.
27 if sys.version_info < (2, 7):
28     install_requires.extend([
29         # only some distros recognize stdlib argparse as already satisfying
30         'argparse',
31         'mock<1.1.0',
32     ])
33 else:
34     install_requires.append('mock')
35 
36 dev_extras = [
37     'nose',
38     'tox',
39 ]
40 
41 docs_extras = [
42     'Sphinx>=1.0',  # autodoc_member_order = 'bysource', autodoc_default_flags
43     'sphinx_rtd_theme',
44 ]
45 
46 
47 setup(
48     name='acme',
49     version=version,
50     description='ACME protocol implementation in Python',
51     url='https://github.com/letsencrypt/letsencrypt',
52     author="Certbot Project",
53     author_email='client-dev@letsencrypt.org',
54     license='Apache License 2.0',
55     classifiers=[
56         'Development Status :: 3 - Alpha',
57         'Intended Audience :: Developers',
58         'License :: OSI Approved :: Apache Software License',
59         'Programming Language :: Python',
60         'Programming Language :: Python :: 2',
61         'Programming Language :: Python :: 2.6',
62         'Programming Language :: Python :: 2.7',
63         'Programming Language :: Python :: 3',
64         'Programming Language :: Python :: 3.3',
65         'Programming Language :: Python :: 3.4',
66         'Programming Language :: Python :: 3.5',
67         'Topic :: Internet :: WWW/HTTP',
68         'Topic :: Security',
69     ],
70 
71     packages=find_packages(),
72     include_package_data=True,
73     install_requires=install_requires,
74     extras_require={
75         'dev': dev_extras,
76         'docs': docs_extras,
77     },
78     entry_points={
79         'console_scripts': [
80             'jws = acme.jose.jws:CLI.run',
81         ],
82     },
83     test_suite='acme',
84 )
85
```
--- 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/acme/setup.py b/acme/setup.py
--- a/acme/setup.py
+++ b/acme/setup.py
@@ -15,7 +15,11 @@
     'PyOpenSSL>=0.13',
     'pyrfc3339',
     'pytz',
-    'requests[security]>=2.4.1',  # security extras added in 2.4.1
+    # requests>=2.10 is required to fix
+    # https://github.com/shazow/urllib3/issues/556. This requirement can be
+    # relaxed to 'requests[security]>=2.4.1', however, less useful errors
+    # will be raised for some network/SSL errors.
+    'requests[security]>=2.10',
     # For pkg_resources. >=1.0 so pip resolves it to a version cryptography
     # will tolerate; see #2599:
     'setuptools>=1.0',

{"golden_diff": "diff --git a/acme/setup.py b/acme/setup.py\n--- a/acme/setup.py\n+++ b/acme/setup.py\n@@ -15,7 +15,11 @@\n     'PyOpenSSL>=0.13',\n     'pyrfc3339',\n     'pytz',\n-    'requests[security]>=2.4.1',  # security extras added in 2.4.1\n+    # requests>=2.10 is required to fix\n+    # https://github.com/shazow/urllib3/issues/556. This requirement can be\n+    # relaxed to 'requests[security]>=2.4.1', however, less useful errors\n+    # will be raised for some network/SSL errors.\n+    'requests[security]>=2.10',\n     # For pkg_resources. >=1.0 so pip resolves it to a version cryptography\n     # will tolerate; see #2599:\n     'setuptools>=1.0',\n", "issue": "returned non-string (type Error)\nHey there, I installed certbot as per the doc's from letsencrypt on Debian Jessie and certbot in manual mode returns:\r\n\r\ncertbot certonly --manual -d mydomain.com\r\n\r\n```\r\nAn unexpected error occurred:\r\nTypeError: __str__ returned non-string (type Error)\r\n```\r\n\r\n```\r\npip2 list\r\nacme (0.9.3)\r\n...\r\ncertbot (0.9.3)\r\ncryptography (1.5.3)\r\n...\r\npyOpenSSL (16.0.0)\r\n```\r\n\r\nAnyone seen this before and can offer a solution? Thanks\r\n\n", "before_files": [{"content": "import sys\n\nfrom setuptools import setup\nfrom setuptools import find_packages\n\n\nversion = '0.12.0.dev0'\n\n# Please update tox.ini when modifying dependency version requirements\ninstall_requires = [\n    # load_pem_private/public_key (>=0.6)\n    # rsa_recover_prime_factors (>=0.8)\n    'cryptography>=0.8',\n    # Connection.set_tlsext_host_name (>=0.13)\n    'PyOpenSSL>=0.13',\n    'pyrfc3339',\n    'pytz',\n    'requests[security]>=2.4.1',  # security extras added in 2.4.1\n    # For pkg_resources. >=1.0 so pip resolves it to a version cryptography\n    # will tolerate; see #2599:\n    'setuptools>=1.0',\n    'six',\n]\n\n# env markers in extras_require cause problems with older pip: #517\n# Keep in sync with conditional_requirements.py.\nif sys.version_info < (2, 7):\n    install_requires.extend([\n        # only some distros recognize stdlib argparse as already satisfying\n        'argparse',\n        'mock<1.1.0',\n    ])\nelse:\n    install_requires.append('mock')\n\ndev_extras = [\n    'nose',\n    'tox',\n]\n\ndocs_extras = [\n    'Sphinx>=1.0',  # autodoc_member_order = 'bysource', autodoc_default_flags\n    'sphinx_rtd_theme',\n]\n\n\nsetup(\n    name='acme',\n    version=version,\n    description='ACME protocol implementation in Python',\n    url='https://github.com/letsencrypt/letsencrypt',\n    author=\"Certbot Project\",\n    author_email='client-dev@letsencrypt.org',\n    license='Apache License 2.0',\n    classifiers=[\n        'Development Status :: 3 - Alpha',\n        'Intended Audience :: Developers',\n        'License :: OSI Approved :: Apache Software License',\n        'Programming Language :: Python',\n        'Programming Language :: Python :: 2',\n        'Programming Language :: Python :: 2.6',\n        'Programming Language :: Python :: 2.7',\n        'Programming Language :: Python :: 3',\n        'Programming Language :: Python :: 3.3',\n        'Programming Language :: Python :: 3.4',\n        'Programming Language :: Python :: 3.5',\n        'Topic :: Internet :: WWW/HTTP',\n        'Topic :: Security',\n    ],\n\n    packages=find_packages(),\n    include_package_data=True,\n    install_requires=install_requires,\n    extras_require={\n        'dev': dev_extras,\n        'docs': docs_extras,\n    },\n    entry_points={\n        'console_scripts': [\n            'jws = acme.jose.jws:CLI.run',\n        ],\n    },\n    test_suite='acme',\n)\n", "path": "acme/setup.py"}], "after_files": [{"content": "import sys\n\nfrom setuptools import setup\nfrom setuptools import find_packages\n\n\nversion = '0.12.0.dev0'\n\n# Please update tox.ini when modifying dependency version requirements\ninstall_requires = [\n    # load_pem_private/public_key (>=0.6)\n    # rsa_recover_prime_factors (>=0.8)\n    'cryptography>=0.8',\n    # Connection.set_tlsext_host_name (>=0.13)\n    'PyOpenSSL>=0.13',\n    'pyrfc3339',\n    'pytz',\n    # requests>=2.10 is required to fix\n    # https://github.com/shazow/urllib3/issues/556. This requirement can be\n    # relaxed to 'requests[security]>=2.4.1', however, less useful errors\n    # will be raised for some network/SSL errors.\n    'requests[security]>=2.10',\n    # For pkg_resources. >=1.0 so pip resolves it to a version cryptography\n    # will tolerate; see #2599:\n    'setuptools>=1.0',\n    'six',\n]\n\n# env markers in extras_require cause problems with older pip: #517\n# Keep in sync with conditional_requirements.py.\nif sys.version_info < (2, 7):\n    install_requires.extend([\n        # only some distros recognize stdlib argparse as already satisfying\n        'argparse',\n        'mock<1.1.0',\n    ])\nelse:\n    install_requires.append('mock')\n\ndev_extras = [\n    'nose',\n    'tox',\n]\n\ndocs_extras = [\n    'Sphinx>=1.0',  # autodoc_member_order = 'bysource', autodoc_default_flags\n    'sphinx_rtd_theme',\n]\n\n\nsetup(\n    name='acme',\n    version=version,\n    description='ACME protocol implementation in Python',\n    url='https://github.com/letsencrypt/letsencrypt',\n    author=\"Certbot Project\",\n    author_email='client-dev@letsencrypt.org',\n    license='Apache License 2.0',\n    classifiers=[\n        'Development Status :: 3 - Alpha',\n        'Intended Audience :: Developers',\n        'License :: OSI Approved :: Apache Software License',\n        'Programming Language :: Python',\n        'Programming Language :: Python :: 2',\n        'Programming Language :: Python :: 2.6',\n        'Programming Language :: Python :: 2.7',\n        'Programming Language :: Python :: 3',\n        'Programming Language :: Python :: 3.3',\n        'Programming Language :: Python :: 3.4',\n        'Programming Language :: Python :: 3.5',\n        'Topic :: Internet :: WWW/HTTP',\n        'Topic :: Security',\n    ],\n\n    packages=find_packages(),\n    include_package_data=True,\n    install_requires=install_requires,\n    extras_require={\n        'dev': dev_extras,\n        'docs': docs_extras,\n    },\n    entry_points={\n        'console_scripts': [\n            'jws = acme.jose.jws:CLI.run',\n        ],\n    },\n    test_suite='acme',\n)\n", "path": "acme/setup.py"}]}