prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Raw HTML in README.rst causing problems with uploading dists
  See: https://travis-ci.org/github/urllib3/urllib3/builds/675807537
  
  For now I've manually uploaded the dists.
  
  We should strip this section from our `long_description` field and maybe run `twine check` within our CI to make sure we don't run into this issue on release time in the future.
  
  --- 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 
  3 from setuptools import setup
  4 
  5 import os
  6 import re
  7 import codecs
  8 
  9 base_path = os.path.dirname(__file__)
  10 
  11 # Get the version (borrowed from SQLAlchemy)
  12 with open(os.path.join(base_path, "src", "urllib3", "__init__.py")) as fp:
  13     VERSION = (
  14         re.compile(r""".*__version__ = ["'](.*?)['"]""", re.S).match(fp.read()).group(1)
  15     )
  16 
  17 
  18 with codecs.open("README.rst", encoding="utf-8") as fp:
  19     readme = fp.read()
  20 
  21 with codecs.open("CHANGES.rst", encoding="utf-8") as fp:
  22     changes = fp.read()
  23 
  24 version = VERSION
  25 
  26 setup(
  27     name="urllib3",
  28     version=version,
  29     description="HTTP library with thread-safe connection pooling, file post, and more.",
  30     long_description=u"\n\n".join([readme, changes]),
  31     classifiers=[
  32         "Environment :: Web Environment",
  33         "Intended Audience :: Developers",
  34         "License :: OSI Approved :: MIT License",
  35         "Operating System :: OS Independent",
  36         "Programming Language :: Python",
  37         "Programming Language :: Python :: 2",
  38         "Programming Language :: Python :: 2.7",
  39         "Programming Language :: Python :: 3",
  40         "Programming Language :: Python :: 3.5",
  41         "Programming Language :: Python :: 3.6",
  42         "Programming Language :: Python :: 3.7",
  43         "Programming Language :: Python :: 3.8",
  44         "Programming Language :: Python :: 3.9",
  45         "Programming Language :: Python :: Implementation :: CPython",
  46         "Programming Language :: Python :: Implementation :: PyPy",
  47         "Topic :: Internet :: WWW/HTTP",
  48         "Topic :: Software Development :: Libraries",
  49     ],
  50     keywords="urllib httplib threadsafe filepost http https ssl pooling",
  51     author="Andrey Petrov",
  52     author_email="andrey.petrov@shazow.net",
  53     url="https://urllib3.readthedocs.io/",
  54     project_urls={
  55         "Documentation": "https://urllib3.readthedocs.io/",
  56         "Code": "https://github.com/urllib3/urllib3",
  57         "Issue tracker": "https://github.com/urllib3/urllib3/issues",
  58     },
  59     license="MIT",
  60     packages=[
  61         "urllib3",
  62         "urllib3.packages",
  63         "urllib3.packages.ssl_match_hostname",
  64         "urllib3.packages.backports",
  65         "urllib3.contrib",
  66         "urllib3.contrib._securetransport",
  67         "urllib3.util",
  68     ],
  69     package_dir={"": "src"},
  70     requires=[],
  71     python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4",
  72     extras_require={
  73         "brotli": ["brotlipy>=0.6.0"],
  74         "secure": [
  75             "pyOpenSSL>=0.14",
  76             "cryptography>=1.3.4",
  77             "idna>=2.0.0",
  78             "certifi",
  79             "ipaddress; python_version=='2.7'",
  80         ],
  81         "socks": ["PySocks>=1.5.6,<2.0,!=1.5.7"],
  82     },
  83 )
  84
  ```
  --- 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/setup.py b/setup.py
  --- a/setup.py
  +++ b/setup.py
  @@ -16,7 +16,18 @@
   
   
   with codecs.open("README.rst", encoding="utf-8") as fp:
  -    readme = fp.read()
  +    # remove reST raw directive from README
  +    mode = None
  +    lines = []
  +    for line in fp:
  +        if line.startswith(".. raw"):
  +            mode = "ignore_raw"
  +        elif line == "\n":
  +            mode = None
  +
  +        if mode != "ignore_raw":
  +            lines.append(line)
  +    readme = "".join(lines)
   
   with codecs.open("CHANGES.rst", encoding="utf-8") as fp:
       changes = fp.read()
  @@ -28,6 +39,7 @@
       version=version,
       description="HTTP library with thread-safe connection pooling, file post, and more.",
       long_description=u"\n\n".join([readme, changes]),
  +    long_description_content_type="text/x-rst",
       classifiers=[
           "Environment :: Web Environment",
           "Intended Audience :: Developers",
  
verification_info: {"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -16,7 +16,18 @@\n \n \n with codecs.open(\"README.rst\", encoding=\"utf-8\") as fp:\n-    readme = fp.read()\n+    # remove reST raw directive from README\n+    mode = None\n+    lines = []\n+    for line in fp:\n+        if line.startswith(\".. raw\"):\n+            mode = \"ignore_raw\"\n+        elif line == \"\\n\":\n+            mode = None\n+\n+        if mode != \"ignore_raw\":\n+            lines.append(line)\n+    readme = \"\".join(lines)\n \n with codecs.open(\"CHANGES.rst\", encoding=\"utf-8\") as fp:\n     changes = fp.read()\n@@ -28,6 +39,7 @@\n     version=version,\n     description=\"HTTP library with thread-safe connection pooling, file post, and more.\",\n     long_description=u\"\\n\\n\".join([readme, changes]),\n+    long_description_content_type=\"text/x-rst\",\n     classifiers=[\n         \"Environment :: Web Environment\",\n         \"Intended Audience :: Developers\",\n", "issue": "Raw HTML in README.rst causing problems with uploading dists\nSee: https://travis-ci.org/github/urllib3/urllib3/builds/675807537\r\n\r\nFor now I've manually uploaded the dists.\r\n\r\nWe should strip this section from our `long_description` field and maybe run `twine check` within our CI to make sure we don't run into this issue on release time in the future.\n", "before_files": [{"content": "#!/usr/bin/env python\n\nfrom setuptools import setup\n\nimport os\nimport re\nimport codecs\n\nbase_path = os.path.dirname(__file__)\n\n# Get the version (borrowed from SQLAlchemy)\nwith open(os.path.join(base_path, \"src\", \"urllib3\", \"__init__.py\")) as fp:\n    VERSION = (\n        re.compile(r\"\"\".*__version__ = [\"'](.*?)['\"]\"\"\", re.S).match(fp.read()).group(1)\n    )\n\n\nwith codecs.open(\"README.rst\", encoding=\"utf-8\") as fp:\n    readme = fp.read()\n\nwith codecs.open(\"CHANGES.rst\", encoding=\"utf-8\") as fp:\n    changes = fp.read()\n\nversion = VERSION\n\nsetup(\n    name=\"urllib3\",\n    version=version,\n    description=\"HTTP library with thread-safe connection pooling, file post, and more.\",\n    long_description=u\"\\n\\n\".join([readme, changes]),\n    classifiers=[\n        \"Environment :: Web Environment\",\n        \"Intended Audience :: Developers\",\n        \"License :: OSI Approved :: MIT License\",\n        \"Operating System :: OS Independent\",\n        \"Programming Language :: Python\",\n        \"Programming Language :: Python :: 2\",\n        \"Programming Language :: Python :: 2.7\",\n        \"Programming Language :: Python :: 3\",\n        \"Programming Language :: Python :: 3.5\",\n        \"Programming Language :: Python :: 3.6\",\n        \"Programming Language :: Python :: 3.7\",\n        \"Programming Language :: Python :: 3.8\",\n        \"Programming Language :: Python :: 3.9\",\n        \"Programming Language :: Python :: Implementation :: CPython\",\n        \"Programming Language :: Python :: Implementation :: PyPy\",\n        \"Topic :: Internet :: WWW/HTTP\",\n        \"Topic :: Software Development :: Libraries\",\n    ],\n    keywords=\"urllib httplib threadsafe filepost http https ssl pooling\",\n    author=\"Andrey Petrov\",\n    author_email=\"andrey.petrov@shazow.net\",\n    url=\"https://urllib3.readthedocs.io/\",\n    project_urls={\n        \"Documentation\": \"https://urllib3.readthedocs.io/\",\n        \"Code\": \"https://github.com/urllib3/urllib3\",\n        \"Issue tracker\": \"https://github.com/urllib3/urllib3/issues\",\n    },\n    license=\"MIT\",\n    packages=[\n        \"urllib3\",\n        \"urllib3.packages\",\n        \"urllib3.packages.ssl_match_hostname\",\n        \"urllib3.packages.backports\",\n        \"urllib3.contrib\",\n        \"urllib3.contrib._securetransport\",\n        \"urllib3.util\",\n    ],\n    package_dir={\"\": \"src\"},\n    requires=[],\n    python_requires=\">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4\",\n    extras_require={\n        \"brotli\": [\"brotlipy>=0.6.0\"],\n        \"secure\": [\n            \"pyOpenSSL>=0.14\",\n            \"cryptography>=1.3.4\",\n            \"idna>=2.0.0\",\n            \"certifi\",\n            \"ipaddress; python_version=='2.7'\",\n        ],\n        \"socks\": [\"PySocks>=1.5.6,<2.0,!=1.5.7\"],\n    },\n)\n", "path": "setup.py"}], "after_files": [{"content": "#!/usr/bin/env python\n\nfrom setuptools import setup\n\nimport os\nimport re\nimport codecs\n\nbase_path = os.path.dirname(__file__)\n\n# Get the version (borrowed from SQLAlchemy)\nwith open(os.path.join(base_path, \"src\", \"urllib3\", \"__init__.py\")) as fp:\n    VERSION = (\n        re.compile(r\"\"\".*__version__ = [\"'](.*?)['\"]\"\"\", re.S).match(fp.read()).group(1)\n    )\n\n\nwith codecs.open(\"README.rst\", encoding=\"utf-8\") as fp:\n    # remove reST raw directive from README\n    mode = None\n    lines = []\n    for line in fp:\n        if line.startswith(\".. raw\"):\n            mode = \"ignore_raw\"\n        elif line == \"\\n\":\n            mode = None\n\n        if mode != \"ignore_raw\":\n            lines.append(line)\n    readme = \"\".join(lines)\n\nwith codecs.open(\"CHANGES.rst\", encoding=\"utf-8\") as fp:\n    changes = fp.read()\n\nversion = VERSION\n\nsetup(\n    name=\"urllib3\",\n    version=version,\n    description=\"HTTP library with thread-safe connection pooling, file post, and more.\",\n    long_description=u\"\\n\\n\".join([readme, changes]),\n    long_description_content_type=\"text/x-rst\",\n    classifiers=[\n        \"Environment :: Web Environment\",\n        \"Intended Audience :: Developers\",\n        \"License :: OSI Approved :: MIT License\",\n        \"Operating System :: OS Independent\",\n        \"Programming Language :: Python\",\n        \"Programming Language :: Python :: 2\",\n        \"Programming Language :: Python :: 2.7\",\n        \"Programming Language :: Python :: 3\",\n        \"Programming Language :: Python :: 3.5\",\n        \"Programming Language :: Python :: 3.6\",\n        \"Programming Language :: Python :: 3.7\",\n        \"Programming Language :: Python :: 3.8\",\n        \"Programming Language :: Python :: 3.9\",\n        \"Programming Language :: Python :: Implementation :: CPython\",\n        \"Programming Language :: Python :: Implementation :: PyPy\",\n        \"Topic :: Internet :: WWW/HTTP\",\n        \"Topic :: Software Development :: Libraries\",\n    ],\n    keywords=\"urllib httplib threadsafe filepost http https ssl pooling\",\n    author=\"Andrey Petrov\",\n    author_email=\"andrey.petrov@shazow.net\",\n    url=\"https://urllib3.readthedocs.io/\",\n    project_urls={\n        \"Documentation\": \"https://urllib3.readthedocs.io/\",\n        \"Code\": \"https://github.com/urllib3/urllib3\",\n        \"Issue tracker\": \"https://github.com/urllib3/urllib3/issues\",\n    },\n    license=\"MIT\",\n    packages=[\n        \"urllib3\",\n        \"urllib3.packages\",\n        \"urllib3.packages.ssl_match_hostname\",\n        \"urllib3.packages.backports\",\n        \"urllib3.contrib\",\n        \"urllib3.contrib._securetransport\",\n        \"urllib3.util\",\n    ],\n    package_dir={\"\": \"src\"},\n    requires=[],\n    python_requires=\">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4\",\n    extras_require={\n        \"brotli\": [\"brotlipy>=0.6.0\"],\n        \"secure\": [\n            \"pyOpenSSL>=0.14\",\n            \"cryptography>=1.3.4\",\n            \"idna>=2.0.0\",\n            \"certifi\",\n            \"ipaddress; python_version=='2.7'\",\n        ],\n        \"socks\": [\"PySocks>=1.5.6,<2.0,!=1.5.7\"],\n    },\n)\n", "path": "setup.py"}]}