We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
move to sphinx 1.3.5
sphinx 1.3.4 introduced this bug: https://github.com/sphinx-doc/sphinx/issues/2247
, which breaks builds of projects using definition lists containing regular expression like strings.

This was considered a high priority bug by the sphinx devs and was fixed with version 1.3.5.
Please move to the new version so that I can again build my docs.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `readthedocs/doc_builder/python_environments.py`
Content:
```
1 import logging
2 import os
3 import shutil
4 
5 from django.conf import settings
6 
7 from readthedocs.doc_builder.config import ConfigWrapper
8 from readthedocs.doc_builder.loader import get_builder_class
9 from readthedocs.projects.constants import LOG_TEMPLATE
10 
11 log = logging.getLogger(__name__)
12 
13 
14 class PythonEnvironment(object):
15 
16     def __init__(self, version, build_env, config=None):
17         self.version = version
18         self.project = version.project
19         self.build_env = build_env
20         if config:
21             self.config = config
22         else:
23             self.config = ConfigWrapper(version=version, yaml_config={})
24         # Compute here, since it's used a lot
25         self.checkout_path = self.project.checkout_path(self.version.slug)
26 
27     def _log(self, msg):
28         log.info(LOG_TEMPLATE
29                  .format(project=self.project.slug,
30                          version=self.version.slug,
31                          msg=msg))
32 
33     def delete_existing_build_dir(self):
34 
35         # Handle deleting old build dir
36         build_dir = os.path.join(
37             self.venv_path(),
38             'build')
39         if os.path.exists(build_dir):
40             self._log('Removing existing build directory')
41             shutil.rmtree(build_dir)
42 
43     def install_package(self):
44         setup_path = os.path.join(self.checkout_path, 'setup.py')
45         if os.path.isfile(setup_path) and self.config.install_project:
46             if getattr(settings, 'USE_PIP_INSTALL', False):
47                 self.build_env.run(
48                     'python',
49                     self.venv_bin(filename='pip'),
50                     'install',
51                     '--ignore-installed',
52                     '--cache-dir',
53                     self.project.pip_cache_path,
54                     '.',
55                     cwd=self.checkout_path,
56                     bin_path=self.venv_bin()
57                 )
58             else:
59                 self.build_env.run(
60                     'python',
61                     'setup.py',
62                     'install',
63                     '--force',
64                     cwd=self.checkout_path,
65                     bin_path=self.venv_bin()
66                 )
67 
68     def venv_bin(self, filename=None):
69         """Return path to the virtualenv bin path, or a specific binary
70 
71         :param filename: If specified, add this filename to the path return
72         :returns: Path to virtualenv bin or filename in virtualenv bin
73         """
74         parts = [self.venv_path(), 'bin']
75         if filename is not None:
76             parts.append(filename)
77         return os.path.join(*parts)
78 
79 
80 class Virtualenv(PythonEnvironment):
81 
82     def venv_path(self):
83         return os.path.join(self.project.doc_path, 'envs', self.version.slug)
84 
85     def setup_base(self):
86         site_packages = '--no-site-packages'
87         if self.config.use_system_site_packages:
88             site_packages = '--system-site-packages'
89         env_path = self.venv_path()
90         self.build_env.run(
91             self.config.python_interpreter,
92             '-mvirtualenv',
93             site_packages,
94             env_path,
95             bin_path=None,  # Don't use virtualenv bin that doesn't exist yet
96         )
97 
98     def install_core_requirements(self):
99         requirements = [
100             'sphinx==1.3.4',
101             'Pygments==2.0.2',
102             'setuptools==18.6.1',
103             'docutils==0.12',
104             'mkdocs==0.15.0',
105             'mock==1.0.1',
106             'pillow==2.6.1',
107             'readthedocs-sphinx-ext==0.5.4',
108             'sphinx-rtd-theme==0.1.9',
109             'alabaster>=0.7,<0.8,!=0.7.5',
110             'commonmark==0.5.4',
111             'recommonmark==0.1.1',
112         ]
113 
114         cmd = [
115             'python',
116             self.venv_bin(filename='pip'),
117             'install',
118             '--use-wheel',
119             '-U',
120             '--cache-dir',
121             self.project.pip_cache_path,
122         ]
123         if self.config.use_system_site_packages:
124             # Other code expects sphinx-build to be installed inside the
125             # virtualenv.  Using the -I option makes sure it gets installed
126             # even if it is already installed system-wide (and
127             # --system-site-packages is used)
128             cmd.append('-I')
129         cmd.extend(requirements)
130         self.build_env.run(
131             *cmd,
132             bin_path=self.venv_bin()
133         )
134 
135     def install_user_requirements(self):
136         requirements_file_path = self.config.requirements_file
137         if not requirements_file_path:
138             builder_class = get_builder_class(self.project.documentation_type)
139             docs_dir = (builder_class(build_env=self.build_env, python_env=self)
140                         .docs_dir())
141             for path in [docs_dir, '']:
142                 for req_file in ['pip_requirements.txt', 'requirements.txt']:
143                     test_path = os.path.join(self.checkout_path, path, req_file)
144                     if os.path.exists(test_path):
145                         requirements_file_path = test_path
146                         break
147 
148         if requirements_file_path:
149             self.build_env.run(
150                 'python',
151                 self.venv_bin(filename='pip'),
152                 'install',
153                 '--exists-action=w',
154                 '--cache-dir',
155                 self.project.pip_cache_path,
156                 '-r{0}'.format(requirements_file_path),
157                 cwd=self.checkout_path,
158                 bin_path=self.venv_bin()
159             )
160 
161 
162 class Conda(PythonEnvironment):
163 
164     def venv_path(self):
165         return os.path.join(self.project.doc_path, 'conda', self.version.slug)
166 
167     def setup_base(self):
168         conda_env_path = os.path.join(self.project.doc_path, 'conda')
169         version_path = os.path.join(conda_env_path, self.version.slug)
170 
171         if os.path.exists(version_path):
172             # Re-create conda directory each time to keep fresh state
173             self._log('Removing existing conda directory')
174             shutil.rmtree(version_path)
175         self.build_env.run(
176             'conda',
177             'env',
178             'create',
179             '--name',
180             self.version.slug,
181             '--file',
182             self.config.conda_file,
183             bin_path=None,  # Don't use conda bin that doesn't exist yet
184         )
185 
186     def install_core_requirements(self):
187 
188         # Use conda for requirements it packages
189         requirements = [
190             'sphinx==1.3.1',
191             'Pygments==2.0.2',
192             'docutils==0.12',
193             'mock',
194             'pillow==3.0.0',
195             'sphinx_rtd_theme==0.1.7',
196             'alabaster>=0.7,<0.8,!=0.7.5',
197         ]
198 
199         cmd = [
200             'conda',
201             'install',
202             '--yes',
203             '--name',
204             self.version.slug,
205         ]
206         cmd.extend(requirements)
207         self.build_env.run(
208             *cmd
209         )
210 
211         # Install pip-only things.
212         pip_requirements = [
213             'mkdocs==0.15.0',
214             'readthedocs-sphinx-ext==0.5.4',
215             'commonmark==0.5.4',
216             'recommonmark==0.1.1',
217         ]
218 
219         pip_cmd = [
220             'python',
221             self.venv_bin(filename='pip'),
222             'install',
223             '-U',
224             '--cache-dir',
225             self.project.pip_cache_path,
226         ]
227         pip_cmd.extend(pip_requirements)
228         self.build_env.run(
229             *pip_cmd,
230             bin_path=self.venv_bin()
231         )
232 
233     def install_user_requirements(self):
234         self.build_env.run(
235             'conda',
236             'env',
237             'update',
238             '--name',
239             self.version.slug,
240             '--file',
241             self.config.conda_file,
242         )
243
```
--- 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/readthedocs/doc_builder/python_environments.py b/readthedocs/doc_builder/python_environments.py
--- a/readthedocs/doc_builder/python_environments.py
+++ b/readthedocs/doc_builder/python_environments.py
@@ -97,7 +97,7 @@
 
     def install_core_requirements(self):
         requirements = [
-            'sphinx==1.3.4',
+            'sphinx==1.3.5',
             'Pygments==2.0.2',
             'setuptools==18.6.1',
             'docutils==0.12',
@@ -187,7 +187,7 @@
 
         # Use conda for requirements it packages
         requirements = [
-            'sphinx==1.3.1',
+            'sphinx==1.3.5',
             'Pygments==2.0.2',
             'docutils==0.12',
             'mock',

{"golden_diff": "diff --git a/readthedocs/doc_builder/python_environments.py b/readthedocs/doc_builder/python_environments.py\n--- a/readthedocs/doc_builder/python_environments.py\n+++ b/readthedocs/doc_builder/python_environments.py\n@@ -97,7 +97,7 @@\n \n     def install_core_requirements(self):\n         requirements = [\n-            'sphinx==1.3.4',\n+            'sphinx==1.3.5',\n             'Pygments==2.0.2',\n             'setuptools==18.6.1',\n             'docutils==0.12',\n@@ -187,7 +187,7 @@\n \n         # Use conda for requirements it packages\n         requirements = [\n-            'sphinx==1.3.1',\n+            'sphinx==1.3.5',\n             'Pygments==2.0.2',\n             'docutils==0.12',\n             'mock',\n", "issue": "move to sphinx 1.3.5\nsphinx 1.3.4 introduced this bug: https://github.com/sphinx-doc/sphinx/issues/2247\n, which breaks builds of projects using definition lists containing regular expression like strings.\n\nThis was considered a high priority bug by the sphinx devs and was fixed with version 1.3.5.\nPlease move to the new version so that I can again build my docs.\n\n", "before_files": [{"content": "import logging\nimport os\nimport shutil\n\nfrom django.conf import settings\n\nfrom readthedocs.doc_builder.config import ConfigWrapper\nfrom readthedocs.doc_builder.loader import get_builder_class\nfrom readthedocs.projects.constants import LOG_TEMPLATE\n\nlog = logging.getLogger(__name__)\n\n\nclass PythonEnvironment(object):\n\n    def __init__(self, version, build_env, config=None):\n        self.version = version\n        self.project = version.project\n        self.build_env = build_env\n        if config:\n            self.config = config\n        else:\n            self.config = ConfigWrapper(version=version, yaml_config={})\n        # Compute here, since it's used a lot\n        self.checkout_path = self.project.checkout_path(self.version.slug)\n\n    def _log(self, msg):\n        log.info(LOG_TEMPLATE\n                 .format(project=self.project.slug,\n                         version=self.version.slug,\n                         msg=msg))\n\n    def delete_existing_build_dir(self):\n\n        # Handle deleting old build dir\n        build_dir = os.path.join(\n            self.venv_path(),\n            'build')\n        if os.path.exists(build_dir):\n            self._log('Removing existing build directory')\n            shutil.rmtree(build_dir)\n\n    def install_package(self):\n        setup_path = os.path.join(self.checkout_path, 'setup.py')\n        if os.path.isfile(setup_path) and self.config.install_project:\n            if getattr(settings, 'USE_PIP_INSTALL', False):\n                self.build_env.run(\n                    'python',\n                    self.venv_bin(filename='pip'),\n                    'install',\n                    '--ignore-installed',\n                    '--cache-dir',\n                    self.project.pip_cache_path,\n                    '.',\n                    cwd=self.checkout_path,\n                    bin_path=self.venv_bin()\n                )\n            else:\n                self.build_env.run(\n                    'python',\n                    'setup.py',\n                    'install',\n                    '--force',\n                    cwd=self.checkout_path,\n                    bin_path=self.venv_bin()\n                )\n\n    def venv_bin(self, filename=None):\n        \"\"\"Return path to the virtualenv bin path, or a specific binary\n\n        :param filename: If specified, add this filename to the path return\n        :returns: Path to virtualenv bin or filename in virtualenv bin\n        \"\"\"\n        parts = [self.venv_path(), 'bin']\n        if filename is not None:\n            parts.append(filename)\n        return os.path.join(*parts)\n\n\nclass Virtualenv(PythonEnvironment):\n\n    def venv_path(self):\n        return os.path.join(self.project.doc_path, 'envs', self.version.slug)\n\n    def setup_base(self):\n        site_packages = '--no-site-packages'\n        if self.config.use_system_site_packages:\n            site_packages = '--system-site-packages'\n        env_path = self.venv_path()\n        self.build_env.run(\n            self.config.python_interpreter,\n            '-mvirtualenv',\n            site_packages,\n            env_path,\n            bin_path=None,  # Don't use virtualenv bin that doesn't exist yet\n        )\n\n    def install_core_requirements(self):\n        requirements = [\n            'sphinx==1.3.4',\n            'Pygments==2.0.2',\n            'setuptools==18.6.1',\n            'docutils==0.12',\n            'mkdocs==0.15.0',\n            'mock==1.0.1',\n            'pillow==2.6.1',\n            'readthedocs-sphinx-ext==0.5.4',\n            'sphinx-rtd-theme==0.1.9',\n            'alabaster>=0.7,<0.8,!=0.7.5',\n            'commonmark==0.5.4',\n            'recommonmark==0.1.1',\n        ]\n\n        cmd = [\n            'python',\n            self.venv_bin(filename='pip'),\n            'install',\n            '--use-wheel',\n            '-U',\n            '--cache-dir',\n            self.project.pip_cache_path,\n        ]\n        if self.config.use_system_site_packages:\n            # Other code expects sphinx-build to be installed inside the\n            # virtualenv.  Using the -I option makes sure it gets installed\n            # even if it is already installed system-wide (and\n            # --system-site-packages is used)\n            cmd.append('-I')\n        cmd.extend(requirements)\n        self.build_env.run(\n            *cmd,\n            bin_path=self.venv_bin()\n        )\n\n    def install_user_requirements(self):\n        requirements_file_path = self.config.requirements_file\n        if not requirements_file_path:\n            builder_class = get_builder_class(self.project.documentation_type)\n            docs_dir = (builder_class(build_env=self.build_env, python_env=self)\n                        .docs_dir())\n            for path in [docs_dir, '']:\n                for req_file in ['pip_requirements.txt', 'requirements.txt']:\n                    test_path = os.path.join(self.checkout_path, path, req_file)\n                    if os.path.exists(test_path):\n                        requirements_file_path = test_path\n                        break\n\n        if requirements_file_path:\n            self.build_env.run(\n                'python',\n                self.venv_bin(filename='pip'),\n                'install',\n                '--exists-action=w',\n                '--cache-dir',\n                self.project.pip_cache_path,\n                '-r{0}'.format(requirements_file_path),\n                cwd=self.checkout_path,\n                bin_path=self.venv_bin()\n            )\n\n\nclass Conda(PythonEnvironment):\n\n    def venv_path(self):\n        return os.path.join(self.project.doc_path, 'conda', self.version.slug)\n\n    def setup_base(self):\n        conda_env_path = os.path.join(self.project.doc_path, 'conda')\n        version_path = os.path.join(conda_env_path, self.version.slug)\n\n        if os.path.exists(version_path):\n            # Re-create conda directory each time to keep fresh state\n            self._log('Removing existing conda directory')\n            shutil.rmtree(version_path)\n        self.build_env.run(\n            'conda',\n            'env',\n            'create',\n            '--name',\n            self.version.slug,\n            '--file',\n            self.config.conda_file,\n            bin_path=None,  # Don't use conda bin that doesn't exist yet\n        )\n\n    def install_core_requirements(self):\n\n        # Use conda for requirements it packages\n        requirements = [\n            'sphinx==1.3.1',\n            'Pygments==2.0.2',\n            'docutils==0.12',\n            'mock',\n            'pillow==3.0.0',\n            'sphinx_rtd_theme==0.1.7',\n            'alabaster>=0.7,<0.8,!=0.7.5',\n        ]\n\n        cmd = [\n            'conda',\n            'install',\n            '--yes',\n            '--name',\n            self.version.slug,\n        ]\n        cmd.extend(requirements)\n        self.build_env.run(\n            *cmd\n        )\n\n        # Install pip-only things.\n        pip_requirements = [\n            'mkdocs==0.15.0',\n            'readthedocs-sphinx-ext==0.5.4',\n            'commonmark==0.5.4',\n            'recommonmark==0.1.1',\n        ]\n\n        pip_cmd = [\n            'python',\n            self.venv_bin(filename='pip'),\n            'install',\n            '-U',\n            '--cache-dir',\n            self.project.pip_cache_path,\n        ]\n        pip_cmd.extend(pip_requirements)\n        self.build_env.run(\n            *pip_cmd,\n            bin_path=self.venv_bin()\n        )\n\n    def install_user_requirements(self):\n        self.build_env.run(\n            'conda',\n            'env',\n            'update',\n            '--name',\n            self.version.slug,\n            '--file',\n            self.config.conda_file,\n        )\n", "path": "readthedocs/doc_builder/python_environments.py"}], "after_files": [{"content": "import logging\nimport os\nimport shutil\n\nfrom django.conf import settings\n\nfrom readthedocs.doc_builder.config import ConfigWrapper\nfrom readthedocs.doc_builder.loader import get_builder_class\nfrom readthedocs.projects.constants import LOG_TEMPLATE\n\nlog = logging.getLogger(__name__)\n\n\nclass PythonEnvironment(object):\n\n    def __init__(self, version, build_env, config=None):\n        self.version = version\n        self.project = version.project\n        self.build_env = build_env\n        if config:\n            self.config = config\n        else:\n            self.config = ConfigWrapper(version=version, yaml_config={})\n        # Compute here, since it's used a lot\n        self.checkout_path = self.project.checkout_path(self.version.slug)\n\n    def _log(self, msg):\n        log.info(LOG_TEMPLATE\n                 .format(project=self.project.slug,\n                         version=self.version.slug,\n                         msg=msg))\n\n    def delete_existing_build_dir(self):\n\n        # Handle deleting old build dir\n        build_dir = os.path.join(\n            self.venv_path(),\n            'build')\n        if os.path.exists(build_dir):\n            self._log('Removing existing build directory')\n            shutil.rmtree(build_dir)\n\n    def install_package(self):\n        setup_path = os.path.join(self.checkout_path, 'setup.py')\n        if os.path.isfile(setup_path) and self.config.install_project:\n            if getattr(settings, 'USE_PIP_INSTALL', False):\n                self.build_env.run(\n                    'python',\n                    self.venv_bin(filename='pip'),\n                    'install',\n                    '--ignore-installed',\n                    '--cache-dir',\n                    self.project.pip_cache_path,\n                    '.',\n                    cwd=self.checkout_path,\n                    bin_path=self.venv_bin()\n                )\n            else:\n                self.build_env.run(\n                    'python',\n                    'setup.py',\n                    'install',\n                    '--force',\n                    cwd=self.checkout_path,\n                    bin_path=self.venv_bin()\n                )\n\n    def venv_bin(self, filename=None):\n        \"\"\"Return path to the virtualenv bin path, or a specific binary\n\n        :param filename: If specified, add this filename to the path return\n        :returns: Path to virtualenv bin or filename in virtualenv bin\n        \"\"\"\n        parts = [self.venv_path(), 'bin']\n        if filename is not None:\n            parts.append(filename)\n        return os.path.join(*parts)\n\n\nclass Virtualenv(PythonEnvironment):\n\n    def venv_path(self):\n        return os.path.join(self.project.doc_path, 'envs', self.version.slug)\n\n    def setup_base(self):\n        site_packages = '--no-site-packages'\n        if self.config.use_system_site_packages:\n            site_packages = '--system-site-packages'\n        env_path = self.venv_path()\n        self.build_env.run(\n            self.config.python_interpreter,\n            '-mvirtualenv',\n            site_packages,\n            env_path,\n            bin_path=None,  # Don't use virtualenv bin that doesn't exist yet\n        )\n\n    def install_core_requirements(self):\n        requirements = [\n            'sphinx==1.3.5',\n            'Pygments==2.0.2',\n            'setuptools==18.6.1',\n            'docutils==0.12',\n            'mkdocs==0.14.0',\n            'mock==1.0.1',\n            'pillow==2.6.1',\n            'readthedocs-sphinx-ext==0.5.4',\n            'sphinx-rtd-theme==0.1.9',\n            'alabaster>=0.7,<0.8,!=0.7.5',\n            'commonmark==0.5.4',\n            'recommonmark==0.1.1',\n        ]\n\n        cmd = [\n            'python',\n            self.venv_bin(filename='pip'),\n            'install',\n            '--use-wheel',\n            '-U',\n            '--cache-dir',\n            self.project.pip_cache_path,\n        ]\n        if self.config.use_system_site_packages:\n            # Other code expects sphinx-build to be installed inside the\n            # virtualenv.  Using the -I option makes sure it gets installed\n            # even if it is already installed system-wide (and\n            # --system-site-packages is used)\n            cmd.append('-I')\n        cmd.extend(requirements)\n        self.build_env.run(\n            *cmd,\n            bin_path=self.venv_bin()\n        )\n\n    def install_user_requirements(self):\n        requirements_file_path = self.config.requirements_file\n        if not requirements_file_path:\n            builder_class = get_builder_class(self.project.documentation_type)\n            docs_dir = (builder_class(build_env=self.build_env, python_env=self)\n                        .docs_dir())\n            for path in [docs_dir, '']:\n                for req_file in ['pip_requirements.txt', 'requirements.txt']:\n                    test_path = os.path.join(self.checkout_path, path, req_file)\n                    if os.path.exists(test_path):\n                        requirements_file_path = test_path\n                        break\n\n        if requirements_file_path:\n            self.build_env.run(\n                'python',\n                self.venv_bin(filename='pip'),\n                'install',\n                '--exists-action=w',\n                '--cache-dir',\n                self.project.pip_cache_path,\n                '-r{0}'.format(requirements_file_path),\n                cwd=self.checkout_path,\n                bin_path=self.venv_bin()\n            )\n\n\nclass Conda(PythonEnvironment):\n\n    def venv_path(self):\n        return os.path.join(self.project.doc_path, 'conda', self.version.slug)\n\n    def setup_base(self):\n        conda_env_path = os.path.join(self.project.doc_path, 'conda')\n        version_path = os.path.join(conda_env_path, self.version.slug)\n\n        if os.path.exists(version_path):\n            # Re-create conda directory each time to keep fresh state\n            self._log('Removing existing conda directory')\n            shutil.rmtree(version_path)\n        self.build_env.run(\n            'conda',\n            'env',\n            'create',\n            '--name',\n            self.version.slug,\n            '--file',\n            self.config.conda_file,\n            bin_path=None,  # Don't use conda bin that doesn't exist yet\n        )\n\n    def install_core_requirements(self):\n\n        # Use conda for requirements it packages\n        requirements = [\n            'sphinx==1.3.5',\n            'Pygments==2.0.2',\n            'docutils==0.12',\n            'mock',\n            'pillow==3.0.0',\n            'sphinx_rtd_theme==0.1.7',\n            'alabaster>=0.7,<0.8,!=0.7.5',\n        ]\n\n        cmd = [\n            'conda',\n            'install',\n            '--yes',\n            '--name',\n            self.version.slug,\n        ]\n        cmd.extend(requirements)\n        self.build_env.run(\n            *cmd\n        )\n\n        # Install pip-only things.\n        pip_requirements = [\n            'mkdocs==0.14.0',\n            'readthedocs-sphinx-ext==0.5.4',\n            'commonmark==0.5.4',\n            'recommonmark==0.1.1',\n        ]\n\n        pip_cmd = [\n            'python',\n            self.venv_bin(filename='pip'),\n            'install',\n            '-U',\n            '--cache-dir',\n            self.project.pip_cache_path,\n        ]\n        pip_cmd.extend(pip_requirements)\n        self.build_env.run(\n            *pip_cmd,\n            bin_path=self.venv_bin()\n        )\n\n    def install_user_requirements(self):\n        self.build_env.run(\n            'conda',\n            'env',\n            'update',\n            '--name',\n            self.version.slug,\n            '--file',\n            self.config.conda_file,\n        )\n", "path": "readthedocs/doc_builder/python_environments.py"}]}