We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Fix readthedocs build
As discussed in 01/28/2021 SIG.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `docs/conf.py`
Content:
```
1 # Configuration file for the Sphinx documentation builder.
2 #
3 # This file only contains a selection of the most common options. For a full
4 # list see the documentation:
5 # http://www.sphinx-doc.org/en/master/config
6 
7 # -- Path setup --------------------------------------------------------------
8 
9 # If extensions (or modules to document with autodoc) are in another directory,
10 # add these directories to sys.path here. If the directory is relative to the
11 # documentation root, use os.path.abspath to make it absolute, like shown here.
12 
13 import os
14 import sys
15 from configparser import ConfigParser
16 from os import listdir
17 from os.path import isdir, join
18 
19 # configure django to avoid the following exception:
20 # django.core.exceptions.ImproperlyConfigured: Requested settings, but settings
21 # are not configured. You must either define the environment variable
22 # DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
23 from django.conf import settings
24 
25 settings.configure()
26 
27 exp = "../exporter"
28 exp_dirs = [
29     os.path.abspath("/".join(["../exporter", f, "src"]))
30     for f in listdir(exp)
31     if isdir(join(exp, f))
32 ]
33 
34 instr = "../instrumentation"
35 instr_dirs = [
36     os.path.abspath("/".join(["../instrumentation", f, "src"]))
37     for f in listdir(instr)
38     if isdir(join(instr, f))
39 ]
40 
41 sdk_ext = "../sdk-extension"
42 sdk_ext_dirs = [
43     os.path.abspath("/".join(["../sdk-extension", f, "src"]))
44     for f in listdir(sdk_ext)
45     if isdir(join(sdk_ext, f))
46 ]
47 
48 sys.path[:0] = exp_dirs + instr_dirs + sdk_ext_dirs
49 
50 # -- Project information -----------------------------------------------------
51 
52 project = "OpenTelemetry Python Contrib"
53 copyright = "OpenTelemetry Authors"  # pylint: disable=redefined-builtin
54 author = "OpenTelemetry Authors"
55 
56 
57 # -- General configuration ---------------------------------------------------
58 
59 # Easy automatic cross-references for `code in backticks`
60 default_role = "any"
61 
62 # Add any Sphinx extension module names here, as strings. They can be
63 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
64 # ones.
65 extensions = [
66     # API doc generation
67     "sphinx.ext.autodoc",
68     # Support for google-style docstrings
69     "sphinx.ext.napoleon",
70     # Infer types from hints instead of docstrings
71     "sphinx_autodoc_typehints",
72     # Add links to source from generated docs
73     "sphinx.ext.viewcode",
74     # Link to other sphinx docs
75     "sphinx.ext.intersphinx",
76     # Add a .nojekyll file to the generated HTML docs
77     # https://help.github.com/en/articles/files-that-start-with-an-underscore-are-missing
78     "sphinx.ext.githubpages",
79     # Support external links to different versions in the Github repo
80     "sphinx.ext.extlinks",
81 ]
82 
83 intersphinx_mapping = {
84     "python": ("https://docs.python.org/3/", None),
85     "opentracing": (
86         "https://opentracing-python.readthedocs.io/en/latest/",
87         None,
88     ),
89     "aiohttp": ("https://aiohttp.readthedocs.io/en/stable/", None),
90     "wrapt": ("https://wrapt.readthedocs.io/en/latest/", None),
91     "pymongo": ("https://pymongo.readthedocs.io/en/stable/", None),
92     "opentelemetry": (
93         "https://opentelemetry-python.readthedocs.io/en/latest/",
94         None,
95     ),
96 }
97 
98 # http://www.sphinx-doc.org/en/master/config.html#confval-nitpicky
99 # Sphinx will warn about all references where the target cannot be found.
100 nitpicky = True
101 # Sphinx does not recognize generic type TypeVars
102 # Container supposedly were fixed, but does not work
103 # https://github.com/sphinx-doc/sphinx/pull/3744
104 nitpick_ignore = []
105 
106 cfg = ConfigParser()
107 cfg.read("./nitpick-exceptions.ini")
108 mcfg = cfg["default"]
109 
110 
111 def getlistcfg(strval):
112     return [
113         val.strip()
114         for line in strval.split("\n")
115         for val in line.split(",")
116         if val.strip()
117     ]
118 
119 
120 if "class_references" in mcfg:
121     class_references = getlistcfg(mcfg["class_references"])
122     for class_reference in class_references:
123         nitpick_ignore.append(("py:class", class_reference,))
124 
125 if "anys" in mcfg:
126     anys = getlistcfg(mcfg["anys"])
127     for any in anys:
128         nitpick_ignore.append(("any", any,))
129 
130 # Add any paths that contain templates here, relative to this directory.
131 templates_path = ["_templates"]
132 
133 # List of patterns, relative to source directory, that match files and
134 # directories to ignore when looking for source files.
135 # This pattern also affects html_static_path and html_extra_path.
136 exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
137 
138 autodoc_default_options = {
139     "members": True,
140     "undoc-members": True,
141     "show-inheritance": True,
142     "member-order": "bysource",
143 }
144 
145 # -- Options for HTML output -------------------------------------------------
146 
147 # The theme to use for HTML and HTML Help pages.  See the documentation for
148 # a list of builtin themes.
149 #
150 html_theme = "sphinx_rtd_theme"
151 
152 # Add any paths that contain custom static files (such as style sheets) here,
153 # relative to this directory. They are copied after the builtin static files,
154 # so a file named "default.css" will overwrite the builtin "default.css".
155 html_static_path = []
156 
157 # Support external links to specific versions of the files in the Github repo
158 branch = os.environ.get("READTHEDOCS_VERSION")
159 if branch is None or branch == "latest":
160     branch = "main"
161 
162 REPO = "open-telemetry/opentelemetry-python-contrib/"
163 scm_raw_web = "https://raw.githubusercontent.com/" + REPO + branch
164 scm_web = "https://github.com/" + REPO + "blob/" + branch
165 
166 # Store variables in the epilogue so they are globally available.
167 rst_epilog = """
168 .. |SCM_WEB| replace:: {s}
169 .. |SCM_RAW_WEB| replace:: {sr}
170 .. |SCM_BRANCH| replace:: {b}
171 """.format(
172     s=scm_web, sr=scm_raw_web, b=branch
173 )
174 
175 # used to have links to repo files
176 extlinks = {
177     "scm_raw_web": (scm_raw_web + "/%s", "scm_raw_web"),
178     "scm_web": (scm_web + "/%s", "scm_web"),
179 }
180
```
--- 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/docs/conf.py b/docs/conf.py
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -124,8 +124,8 @@
 
 if "anys" in mcfg:
     anys = getlistcfg(mcfg["anys"])
-    for any in anys:
-        nitpick_ignore.append(("any", any,))
+    for _any in anys:
+        nitpick_ignore.append(("any", _any,))
 
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ["_templates"]

{"golden_diff": "diff --git a/docs/conf.py b/docs/conf.py\n--- a/docs/conf.py\n+++ b/docs/conf.py\n@@ -124,8 +124,8 @@\n \n if \"anys\" in mcfg:\n     anys = getlistcfg(mcfg[\"anys\"])\n-    for any in anys:\n-        nitpick_ignore.append((\"any\", any,))\n+    for _any in anys:\n+        nitpick_ignore.append((\"any\", _any,))\n \n # Add any paths that contain templates here, relative to this directory.\n templates_path = [\"_templates\"]\n", "issue": "Fix readthedocs build\nAs discussed in 01/28/2021 SIG.\n", "before_files": [{"content": "# Configuration file for the Sphinx documentation builder.\n#\n# This file only contains a selection of the most common options. For a full\n# list see the documentation:\n# http://www.sphinx-doc.org/en/master/config\n\n# -- Path setup --------------------------------------------------------------\n\n# If extensions (or modules to document with autodoc) are in another directory,\n# add these directories to sys.path here. If the directory is relative to the\n# documentation root, use os.path.abspath to make it absolute, like shown here.\n\nimport os\nimport sys\nfrom configparser import ConfigParser\nfrom os import listdir\nfrom os.path import isdir, join\n\n# configure django to avoid the following exception:\n# django.core.exceptions.ImproperlyConfigured: Requested settings, but settings\n# are not configured. You must either define the environment variable\n# DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.\nfrom django.conf import settings\n\nsettings.configure()\n\nexp = \"../exporter\"\nexp_dirs = [\n    os.path.abspath(\"/\".join([\"../exporter\", f, \"src\"]))\n    for f in listdir(exp)\n    if isdir(join(exp, f))\n]\n\ninstr = \"../instrumentation\"\ninstr_dirs = [\n    os.path.abspath(\"/\".join([\"../instrumentation\", f, \"src\"]))\n    for f in listdir(instr)\n    if isdir(join(instr, f))\n]\n\nsdk_ext = \"../sdk-extension\"\nsdk_ext_dirs = [\n    os.path.abspath(\"/\".join([\"../sdk-extension\", f, \"src\"]))\n    for f in listdir(sdk_ext)\n    if isdir(join(sdk_ext, f))\n]\n\nsys.path[:0] = exp_dirs + instr_dirs + sdk_ext_dirs\n\n# -- Project information -----------------------------------------------------\n\nproject = \"OpenTelemetry Python Contrib\"\ncopyright = \"OpenTelemetry Authors\"  # pylint: disable=redefined-builtin\nauthor = \"OpenTelemetry Authors\"\n\n\n# -- General configuration ---------------------------------------------------\n\n# Easy automatic cross-references for `code in backticks`\ndefault_role = \"any\"\n\n# Add any Sphinx extension module names here, as strings. They can be\n# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom\n# ones.\nextensions = [\n    # API doc generation\n    \"sphinx.ext.autodoc\",\n    # Support for google-style docstrings\n    \"sphinx.ext.napoleon\",\n    # Infer types from hints instead of docstrings\n    \"sphinx_autodoc_typehints\",\n    # Add links to source from generated docs\n    \"sphinx.ext.viewcode\",\n    # Link to other sphinx docs\n    \"sphinx.ext.intersphinx\",\n    # Add a .nojekyll file to the generated HTML docs\n    # https://help.github.com/en/articles/files-that-start-with-an-underscore-are-missing\n    \"sphinx.ext.githubpages\",\n    # Support external links to different versions in the Github repo\n    \"sphinx.ext.extlinks\",\n]\n\nintersphinx_mapping = {\n    \"python\": (\"https://docs.python.org/3/\", None),\n    \"opentracing\": (\n        \"https://opentracing-python.readthedocs.io/en/latest/\",\n        None,\n    ),\n    \"aiohttp\": (\"https://aiohttp.readthedocs.io/en/stable/\", None),\n    \"wrapt\": (\"https://wrapt.readthedocs.io/en/latest/\", None),\n    \"pymongo\": (\"https://pymongo.readthedocs.io/en/stable/\", None),\n    \"opentelemetry\": (\n        \"https://opentelemetry-python.readthedocs.io/en/latest/\",\n        None,\n    ),\n}\n\n# http://www.sphinx-doc.org/en/master/config.html#confval-nitpicky\n# Sphinx will warn about all references where the target cannot be found.\nnitpicky = True\n# Sphinx does not recognize generic type TypeVars\n# Container supposedly were fixed, but does not work\n# https://github.com/sphinx-doc/sphinx/pull/3744\nnitpick_ignore = []\n\ncfg = ConfigParser()\ncfg.read(\"./nitpick-exceptions.ini\")\nmcfg = cfg[\"default\"]\n\n\ndef getlistcfg(strval):\n    return [\n        val.strip()\n        for line in strval.split(\"\\n\")\n        for val in line.split(\",\")\n        if val.strip()\n    ]\n\n\nif \"class_references\" in mcfg:\n    class_references = getlistcfg(mcfg[\"class_references\"])\n    for class_reference in class_references:\n        nitpick_ignore.append((\"py:class\", class_reference,))\n\nif \"anys\" in mcfg:\n    anys = getlistcfg(mcfg[\"anys\"])\n    for any in anys:\n        nitpick_ignore.append((\"any\", any,))\n\n# Add any paths that contain templates here, relative to this directory.\ntemplates_path = [\"_templates\"]\n\n# List of patterns, relative to source directory, that match files and\n# directories to ignore when looking for source files.\n# This pattern also affects html_static_path and html_extra_path.\nexclude_patterns = [\"_build\", \"Thumbs.db\", \".DS_Store\"]\n\nautodoc_default_options = {\n    \"members\": True,\n    \"undoc-members\": True,\n    \"show-inheritance\": True,\n    \"member-order\": \"bysource\",\n}\n\n# -- Options for HTML output -------------------------------------------------\n\n# The theme to use for HTML and HTML Help pages.  See the documentation for\n# a list of builtin themes.\n#\nhtml_theme = \"sphinx_rtd_theme\"\n\n# Add any paths that contain custom static files (such as style sheets) here,\n# relative to this directory. They are copied after the builtin static files,\n# so a file named \"default.css\" will overwrite the builtin \"default.css\".\nhtml_static_path = []\n\n# Support external links to specific versions of the files in the Github repo\nbranch = os.environ.get(\"READTHEDOCS_VERSION\")\nif branch is None or branch == \"latest\":\n    branch = \"main\"\n\nREPO = \"open-telemetry/opentelemetry-python-contrib/\"\nscm_raw_web = \"https://raw.githubusercontent.com/\" + REPO + branch\nscm_web = \"https://github.com/\" + REPO + \"blob/\" + branch\n\n# Store variables in the epilogue so they are globally available.\nrst_epilog = \"\"\"\n.. |SCM_WEB| replace:: {s}\n.. |SCM_RAW_WEB| replace:: {sr}\n.. |SCM_BRANCH| replace:: {b}\n\"\"\".format(\n    s=scm_web, sr=scm_raw_web, b=branch\n)\n\n# used to have links to repo files\nextlinks = {\n    \"scm_raw_web\": (scm_raw_web + \"/%s\", \"scm_raw_web\"),\n    \"scm_web\": (scm_web + \"/%s\", \"scm_web\"),\n}\n", "path": "docs/conf.py"}], "after_files": [{"content": "# Configuration file for the Sphinx documentation builder.\n#\n# This file only contains a selection of the most common options. For a full\n# list see the documentation:\n# http://www.sphinx-doc.org/en/master/config\n\n# -- Path setup --------------------------------------------------------------\n\n# If extensions (or modules to document with autodoc) are in another directory,\n# add these directories to sys.path here. If the directory is relative to the\n# documentation root, use os.path.abspath to make it absolute, like shown here.\n\nimport os\nimport sys\nfrom configparser import ConfigParser\nfrom os import listdir\nfrom os.path import isdir, join\n\n# configure django to avoid the following exception:\n# django.core.exceptions.ImproperlyConfigured: Requested settings, but settings\n# are not configured. You must either define the environment variable\n# DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.\nfrom django.conf import settings\n\nsettings.configure()\n\nexp = \"../exporter\"\nexp_dirs = [\n    os.path.abspath(\"/\".join([\"../exporter\", f, \"src\"]))\n    for f in listdir(exp)\n    if isdir(join(exp, f))\n]\n\ninstr = \"../instrumentation\"\ninstr_dirs = [\n    os.path.abspath(\"/\".join([\"../instrumentation\", f, \"src\"]))\n    for f in listdir(instr)\n    if isdir(join(instr, f))\n]\n\nsdk_ext = \"../sdk-extension\"\nsdk_ext_dirs = [\n    os.path.abspath(\"/\".join([\"../sdk-extension\", f, \"src\"]))\n    for f in listdir(sdk_ext)\n    if isdir(join(sdk_ext, f))\n]\n\nsys.path[:0] = exp_dirs + instr_dirs + sdk_ext_dirs\n\n# -- Project information -----------------------------------------------------\n\nproject = \"OpenTelemetry Python Contrib\"\ncopyright = \"OpenTelemetry Authors\"  # pylint: disable=redefined-builtin\nauthor = \"OpenTelemetry Authors\"\n\n\n# -- General configuration ---------------------------------------------------\n\n# Easy automatic cross-references for `code in backticks`\ndefault_role = \"any\"\n\n# Add any Sphinx extension module names here, as strings. They can be\n# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom\n# ones.\nextensions = [\n    # API doc generation\n    \"sphinx.ext.autodoc\",\n    # Support for google-style docstrings\n    \"sphinx.ext.napoleon\",\n    # Infer types from hints instead of docstrings\n    \"sphinx_autodoc_typehints\",\n    # Add links to source from generated docs\n    \"sphinx.ext.viewcode\",\n    # Link to other sphinx docs\n    \"sphinx.ext.intersphinx\",\n    # Add a .nojekyll file to the generated HTML docs\n    # https://help.github.com/en/articles/files-that-start-with-an-underscore-are-missing\n    \"sphinx.ext.githubpages\",\n    # Support external links to different versions in the Github repo\n    \"sphinx.ext.extlinks\",\n]\n\nintersphinx_mapping = {\n    \"python\": (\"https://docs.python.org/3/\", None),\n    \"opentracing\": (\n        \"https://opentracing-python.readthedocs.io/en/latest/\",\n        None,\n    ),\n    \"aiohttp\": (\"https://aiohttp.readthedocs.io/en/stable/\", None),\n    \"wrapt\": (\"https://wrapt.readthedocs.io/en/latest/\", None),\n    \"pymongo\": (\"https://pymongo.readthedocs.io/en/stable/\", None),\n    \"opentelemetry\": (\n        \"https://opentelemetry-python.readthedocs.io/en/latest/\",\n        None,\n    ),\n}\n\n# http://www.sphinx-doc.org/en/master/config.html#confval-nitpicky\n# Sphinx will warn about all references where the target cannot be found.\nnitpicky = True\n# Sphinx does not recognize generic type TypeVars\n# Container supposedly were fixed, but does not work\n# https://github.com/sphinx-doc/sphinx/pull/3744\nnitpick_ignore = []\n\ncfg = ConfigParser()\ncfg.read(\"./nitpick-exceptions.ini\")\nmcfg = cfg[\"default\"]\n\n\ndef getlistcfg(strval):\n    return [\n        val.strip()\n        for line in strval.split(\"\\n\")\n        for val in line.split(\",\")\n        if val.strip()\n    ]\n\n\nif \"class_references\" in mcfg:\n    class_references = getlistcfg(mcfg[\"class_references\"])\n    for class_reference in class_references:\n        nitpick_ignore.append((\"py:class\", class_reference,))\n\nif \"anys\" in mcfg:\n    anys = getlistcfg(mcfg[\"anys\"])\n    for _any in anys:\n        nitpick_ignore.append((\"any\", _any,))\n\n# Add any paths that contain templates here, relative to this directory.\ntemplates_path = [\"_templates\"]\n\n# List of patterns, relative to source directory, that match files and\n# directories to ignore when looking for source files.\n# This pattern also affects html_static_path and html_extra_path.\nexclude_patterns = [\"_build\", \"Thumbs.db\", \".DS_Store\"]\n\nautodoc_default_options = {\n    \"members\": True,\n    \"undoc-members\": True,\n    \"show-inheritance\": True,\n    \"member-order\": \"bysource\",\n}\n\n# -- Options for HTML output -------------------------------------------------\n\n# The theme to use for HTML and HTML Help pages.  See the documentation for\n# a list of builtin themes.\n#\nhtml_theme = \"sphinx_rtd_theme\"\n\n# Add any paths that contain custom static files (such as style sheets) here,\n# relative to this directory. They are copied after the builtin static files,\n# so a file named \"default.css\" will overwrite the builtin \"default.css\".\nhtml_static_path = []\n\n# Support external links to specific versions of the files in the Github repo\nbranch = os.environ.get(\"READTHEDOCS_VERSION\")\nif branch is None or branch == \"latest\":\n    branch = \"main\"\n\nREPO = \"open-telemetry/opentelemetry-python-contrib/\"\nscm_raw_web = \"https://raw.githubusercontent.com/\" + REPO + branch\nscm_web = \"https://github.com/\" + REPO + \"blob/\" + branch\n\n# Store variables in the epilogue so they are globally available.\nrst_epilog = \"\"\"\n.. |SCM_WEB| replace:: {s}\n.. |SCM_RAW_WEB| replace:: {sr}\n.. |SCM_BRANCH| replace:: {b}\n\"\"\".format(\n    s=scm_web, sr=scm_raw_web, b=branch\n)\n\n# used to have links to repo files\nextlinks = {\n    \"scm_raw_web\": (scm_raw_web + \"/%s\", \"scm_raw_web\"),\n    \"scm_web\": (scm_web + \"/%s\", \"scm_web\"),\n}\n", "path": "docs/conf.py"}]}