We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Requests v2.11.0 causes breakage
This is a known issue within requests and looks like it will be fixed in v2.11.1. Documenting for the benefit of anyone else who runs into this :).

After a recent pip upgrade I found that docker-py was passing along an error from requests:

File "/usr/local/lib/python2.7/dist-packages/docker/client.py", line 307, in _stream_raw_result
   for out in response.iter_content(chunk_size=1, decode_unicode=True):
 File "/usr/local/lib/python2.7/dist-packages/requests/utils.py", line 372, in stream_decode_response_unicode
   raise UnicodeError("Unable to decode contents with encoding %s." % encoding)
UnicodeError: Unable to decode contents with encoding None.

This has already been reported to requests (https://github.com/kennethreitz/requests/issues/3481) and fixed (https://github.com/kennethreitz/requests/commit/d7f56ba9383575a6b7d361db0123a93c70a2b42f) for the next version.

If you are running into this issue, the easiest fix for now appears to be reverting to a pre 2.11 version of requests.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `setup.py`
Content:
```
1 #!/usr/bin/env python
2 import os
3 import sys
4 
5 from setuptools import setup
6 
7 
8 ROOT_DIR = os.path.dirname(__file__)
9 SOURCE_DIR = os.path.join(ROOT_DIR)
10 
11 requirements = [
12     'requests >= 2.5.2',
13     'six >= 1.4.0',
14     'websocket-client >= 0.32.0',
15 ]
16 
17 if sys.platform == 'win32':
18     requirements.append('pypiwin32 >= 219')
19 
20 extras_require = {
21     ':python_version < "3.5"': 'backports.ssl_match_hostname >= 3.5',
22     ':python_version < "3.3"': 'ipaddress >= 1.0.16',
23 }
24 
25 version = None
26 exec(open('docker/version.py').read())
27 
28 with open('./test-requirements.txt') as test_reqs_txt:
29     test_requirements = [line for line in test_reqs_txt]
30 
31 
32 setup(
33     name="docker-py",
34     version=version,
35     description="Python client for Docker.",
36     url='https://github.com/docker/docker-py/',
37     packages=[
38         'docker', 'docker.api', 'docker.auth', 'docker.transport',
39         'docker.utils', 'docker.utils.ports', 'docker.ssladapter'
40     ],
41     install_requires=requirements,
42     tests_require=test_requirements,
43     extras_require=extras_require,
44     zip_safe=False,
45     test_suite='tests',
46     classifiers=[
47         'Development Status :: 4 - Beta',
48         'Environment :: Other Environment',
49         'Intended Audience :: Developers',
50         'Operating System :: OS Independent',
51         'Programming Language :: Python',
52         'Programming Language :: Python :: 2',
53         'Programming Language :: Python :: 2.6',
54         'Programming Language :: Python :: 2.7',
55         'Programming Language :: Python :: 3',
56         'Programming Language :: Python :: 3.3',
57         'Programming Language :: Python :: 3.4',
58         'Programming Language :: Python :: 3.5',
59         'Topic :: Utilities',
60         'License :: OSI Approved :: Apache Software License',
61     ],
62 )
63
```
--- 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/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -9,7 +9,7 @@
 SOURCE_DIR = os.path.join(ROOT_DIR)
 
 requirements = [
-    'requests >= 2.5.2',
+    'requests >= 2.5.2, < 2.11',
     'six >= 1.4.0',
     'websocket-client >= 0.32.0',
 ]

{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -9,7 +9,7 @@\n SOURCE_DIR = os.path.join(ROOT_DIR)\n \n requirements = [\n-    'requests >= 2.5.2',\n+    'requests >= 2.5.2, < 2.11',\n     'six >= 1.4.0',\n     'websocket-client >= 0.32.0',\n ]\n", "issue": "Requests v2.11.0 causes breakage\nThis is a known issue within requests and looks like it will be fixed in v2.11.1. Documenting for the benefit of anyone else who runs into this :).\n\nAfter a recent pip upgrade I found that docker-py was passing along an error from requests:\n\nFile \"/usr/local/lib/python2.7/dist-packages/docker/client.py\", line 307, in _stream_raw_result\n   for out in response.iter_content(chunk_size=1, decode_unicode=True):\n File \"/usr/local/lib/python2.7/dist-packages/requests/utils.py\", line 372, in stream_decode_response_unicode\n   raise UnicodeError(\"Unable to decode contents with encoding %s.\" % encoding)\nUnicodeError: Unable to decode contents with encoding None.\n\nThis has already been reported to requests (https://github.com/kennethreitz/requests/issues/3481) and fixed (https://github.com/kennethreitz/requests/commit/d7f56ba9383575a6b7d361db0123a93c70a2b42f) for the next version.\n\nIf you are running into this issue, the easiest fix for now appears to be reverting to a pre 2.11 version of requests.\n\n", "before_files": [{"content": "#!/usr/bin/env python\nimport os\nimport sys\n\nfrom setuptools import setup\n\n\nROOT_DIR = os.path.dirname(__file__)\nSOURCE_DIR = os.path.join(ROOT_DIR)\n\nrequirements = [\n    'requests >= 2.5.2',\n    'six >= 1.4.0',\n    'websocket-client >= 0.32.0',\n]\n\nif sys.platform == 'win32':\n    requirements.append('pypiwin32 >= 219')\n\nextras_require = {\n    ':python_version < \"3.5\"': 'backports.ssl_match_hostname >= 3.5',\n    ':python_version < \"3.3\"': 'ipaddress >= 1.0.16',\n}\n\nversion = None\nexec(open('docker/version.py').read())\n\nwith open('./test-requirements.txt') as test_reqs_txt:\n    test_requirements = [line for line in test_reqs_txt]\n\n\nsetup(\n    name=\"docker-py\",\n    version=version,\n    description=\"Python client for Docker.\",\n    url='https://github.com/docker/docker-py/',\n    packages=[\n        'docker', 'docker.api', 'docker.auth', 'docker.transport',\n        'docker.utils', 'docker.utils.ports', 'docker.ssladapter'\n    ],\n    install_requires=requirements,\n    tests_require=test_requirements,\n    extras_require=extras_require,\n    zip_safe=False,\n    test_suite='tests',\n    classifiers=[\n        'Development Status :: 4 - Beta',\n        'Environment :: Other Environment',\n        'Intended Audience :: Developers',\n        'Operating System :: OS Independent',\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 :: Utilities',\n        'License :: OSI Approved :: Apache Software License',\n    ],\n)\n", "path": "setup.py"}], "after_files": [{"content": "#!/usr/bin/env python\nimport os\nimport sys\n\nfrom setuptools import setup\n\n\nROOT_DIR = os.path.dirname(__file__)\nSOURCE_DIR = os.path.join(ROOT_DIR)\n\nrequirements = [\n    'requests >= 2.5.2, < 2.11',\n    'six >= 1.4.0',\n    'websocket-client >= 0.32.0',\n]\n\nif sys.platform == 'win32':\n    requirements.append('pypiwin32 >= 219')\n\nextras_require = {\n    ':python_version < \"3.5\"': 'backports.ssl_match_hostname >= 3.5',\n    ':python_version < \"3.3\"': 'ipaddress >= 1.0.16',\n}\n\nversion = None\nexec(open('docker/version.py').read())\n\nwith open('./test-requirements.txt') as test_reqs_txt:\n    test_requirements = [line for line in test_reqs_txt]\n\n\nsetup(\n    name=\"docker-py\",\n    version=version,\n    description=\"Python client for Docker.\",\n    url='https://github.com/docker/docker-py/',\n    packages=[\n        'docker', 'docker.api', 'docker.auth', 'docker.transport',\n        'docker.utils', 'docker.utils.ports', 'docker.ssladapter'\n    ],\n    install_requires=requirements,\n    tests_require=test_requirements,\n    extras_require=extras_require,\n    zip_safe=False,\n    test_suite='tests',\n    classifiers=[\n        'Development Status :: 4 - Beta',\n        'Environment :: Other Environment',\n        'Intended Audience :: Developers',\n        'Operating System :: OS Independent',\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 :: Utilities',\n        'License :: OSI Approved :: Apache Software License',\n    ],\n)\n", "path": "setup.py"}]}