We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
readthedocs build fails due to pycurl
Motivation
----------
Currently the build process on readthedocs fails.

```
Collecting pycurl>=7.19 (from fts3-rest-API==3.7.1->-r requirements.readthedocs.txt (line 44))
  Using cached https://files.pythonhosted.org/packages/e8/e4/0dbb8735407189f00b33d84122b9be52c790c7c3b25286826f4e1bdb7bde/pycurl-7.43.0.2.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-jSh8ZH/pycurl/setup.py", line 913, in <module>
        ext = get_extension(sys.argv, split_extension_source=split_extension_source)
      File "/tmp/pip-build-jSh8ZH/pycurl/setup.py", line 582, in get_extension
        ext_config = ExtensionConfiguration(argv)
      File "/tmp/pip-build-jSh8ZH/pycurl/setup.py", line 99, in __init__
        self.configure()
      File "/tmp/pip-build-jSh8ZH/pycurl/setup.py", line 227, in configure_unix
        raise ConfigurationError(msg)
    __main__.ConfigurationError: Could not run curl-config: [Errno 2] No such file or directory
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-jSh8ZH/pycurl/
You are using pip version 9.0.1, however version 18.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
```


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `doc/source/conf.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 #
3 # Rucio documentation build configuration file, created by
4 # sphinx-quickstart on Fri Oct 27 14:25:40 2017.
5 #
6 # This file is execfile()d with the current directory set to its
7 # containing dir.
8 #
9 # Note that not all possible configuration values are present in this
10 # autogenerated file.
11 #
12 # All configuration values have a default; values that are commented out
13 # serve to show the default.
14 
15 # If extensions (or modules to document with autodoc) are in another directory,
16 # add these directories to sys.path here. If the directory is relative to the
17 # documentation root, use os.path.abspath to make it absolute, like shown here.
18 #
19 import os
20 import sys
21 # sys.path.insert(0, os.path.abspath('.'))
22 
23 from mock import Mock as MagicMock
24 
25 
26 class Mock(MagicMock):
27     @classmethod
28     def __getattr__(cls, name):
29         return Mock()
30 
31     @classmethod
32     def __getitem__(cls, name):
33         return Mock()
34 
35 
36 MOCK_MODULES = ['pycurl']
37 sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
38 
39 # -- General configuration ------------------------------------------------
40 
41 # If your documentation needs a minimal Sphinx version, state it here.
42 #
43 # needs_sphinx = '1.0'
44 
45 # Add any Sphinx extension module names here, as strings. They can be
46 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
47 # ones.
48 extensions = ['sphinx.ext.autodoc',
49               'sphinx.ext.doctest',
50               'sphinx.ext.todo',
51               'rucio.common.doc.argparse.ext',
52               'sphinxcontrib.httpdomain',
53               'sphinxcontrib.autohttp.flask',
54               'sphinxcontrib.autohttp.flaskqref']
55 
56 
57 on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
58 
59 if not on_rtd:  # only import and set the theme if we're building docs locally
60     import sphinx_rtd_theme
61     html_theme = 'sphinx_rtd_theme'
62     html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
63 
64 
65 # Add any paths that contain templates here, relative to this directory.
66 templates_path = ['_templates']
67 
68 # The suffix(es) of source filenames.
69 # You can specify multiple suffix as a list of string:
70 #
71 # source_suffix = ['.rst', '.md']
72 source_suffix = '.rst'
73 
74 # The master toctree document.
75 master_doc = 'index'
76 
77 # General information about the project.
78 project = u'Rucio'
79 copyright = u'2012-2018 CERN for the benefit of the ATLAS collaboration'
80 author = u'rucio-dev@cern.ch'
81 
82 # The version info for the project you're documenting, acts as replacement for
83 # |version| and |release|, also used in various other places throughout the
84 # built documents.
85 #
86 # The short X.Y version.
87 version = u''
88 # The full version, including alpha/beta/rc tags.
89 release = u'1.2'
90 
91 # The language for content autogenerated by Sphinx. Refer to documentation
92 # for a list of supported languages.
93 #
94 # This is also used if you do content translation via gettext catalogs.
95 # Usually you set "language" from the command line for these cases.
96 language = None
97 
98 # List of patterns, relative to source directory, that match files and
99 # directories to ignore when looking for source files.
100 # This patterns also effect to html_static_path and html_extra_path
101 exclude_patterns = []
102 
103 # The name of the Pygments (syntax highlighting) style to use.
104 pygments_style = 'sphinx'
105 
106 # If true, `todo` and `todoList` produce output, else they produce nothing.
107 todo_include_todos = True
108 
109 
110 # -- Options for HTML output ----------------------------------------------
111 
112 # The theme to use for HTML and HTML Help pages.  See the documentation for
113 # a list of builtin themes.
114 #
115 # html_theme = 'alabaster'
116 
117 # Theme options are theme-specific and customize the look and feel of a theme
118 # further.  For a list of options available for each theme, see the
119 # documentation.
120 #
121 # html_theme_options = {}
122 
123 # Add any paths that contain custom static files (such as style sheets) here,
124 # relative to this directory. They are copied after the builtin static files,
125 # so a file named "default.css" will overwrite the builtin "default.css".
126 # html_static_path = ['_static']
127 
128 # Custom sidebar templates, must be a dictionary that maps document names
129 # to template names.
130 #
131 # This is required for the alabaster theme
132 # refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
133 # html_sidebars = {
134 #     '**': [
135 #         'about.html',
136 #         'navigation.html',
137 #         'relations.html',  # needs 'show_related': True theme option to display
138 #         'searchbox.html',
139 #         'donate.html',
140 #     ]
141 # }
142 
143 
144 # -- Options for HTMLHelp output ------------------------------------------
145 
146 # Output file base name for HTML help builder.
147 htmlhelp_basename = 'Ruciodoc'
148 
149 
150 # -- Options for LaTeX output ---------------------------------------------
151 
152 latex_elements = {
153     # The paper size ('letterpaper' or 'a4paper').
154     #
155     # 'papersize': 'letterpaper',
156 
157     # The font size ('10pt', '11pt' or '12pt').
158     #
159     # 'pointsize': '10pt',
160 
161     # Additional stuff for the LaTeX preamble.
162     #
163     # 'preamble': '',
164 
165     # Latex figure (float) alignment
166     #
167     # 'figure_align': 'htbp',
168 }
169 
170 # Grouping the document tree into LaTeX files. List of tuples
171 # (source start file, target name, title,
172 #  author, documentclass [howto, manual, or own class]).
173 latex_documents = [
174     (master_doc, 'Rucio.tex', u'Rucio Documentation',
175      u'rucio-dev@cern.ch', 'manual'),
176 ]
177 
178 
179 # -- Options for manual page output ---------------------------------------
180 
181 # One entry per manual page. List of tuples
182 # (source start file, name, description, authors, manual section).
183 man_pages = [
184     (master_doc, 'rucio', u'Rucio Documentation',
185      [author], 1)
186 ]
187 
188 
189 # -- Options for Texinfo output -------------------------------------------
190 
191 # Grouping the document tree into Texinfo files. List of tuples
192 # (source start file, target name, title, author,
193 #  dir menu entry, description, category)
194 texinfo_documents = [
195     (master_doc, 'Rucio', u'Rucio Documentation',
196      author, 'Rucio', 'One line description of project.',
197      'Miscellaneous'),
198 ]
199
```
--- 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/doc/source/conf.py b/doc/source/conf.py
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -17,9 +17,24 @@
 # documentation root, use os.path.abspath to make it absolute, like shown here.
 #
 import os
-# import sys
+import sys
 # sys.path.insert(0, os.path.abspath('.'))
 
+from mock import Mock as MagicMock
+
+
+class Mock(MagicMock):
+    @classmethod
+    def __getattr__(cls, name):
+        return Mock()
+
+    @classmethod
+    def __getitem__(cls, name):
+        return Mock()
+
+
+MOCK_MODULES = ['pycurl', 'M2Crypto']
+sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
 
 # -- General configuration ------------------------------------------------

{"golden_diff": "diff --git a/doc/source/conf.py b/doc/source/conf.py\n--- a/doc/source/conf.py\n+++ b/doc/source/conf.py\n@@ -17,9 +17,24 @@\n # documentation root, use os.path.abspath to make it absolute, like shown here.\n #\n import os\n-# import sys\n+import sys\n # sys.path.insert(0, os.path.abspath('.'))\n \n+from mock import Mock as MagicMock\n+\n+\n+class Mock(MagicMock):\n+    @classmethod\n+    def __getattr__(cls, name):\n+        return Mock()\n+\n+    @classmethod\n+    def __getitem__(cls, name):\n+        return Mock()\n+\n+\n+MOCK_MODULES = ['pycurl', 'M2Crypto']\n+sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)\n \n # -- General configuration ------------------------------------------------\n", "issue": "readthedocs build fails due to pycurl\nMotivation\r\n----------\r\nCurrently the build process on readthedocs fails.\r\n\r\n```\r\nCollecting pycurl>=7.19 (from fts3-rest-API==3.7.1->-r requirements.readthedocs.txt (line 44))\r\n  Using cached https://files.pythonhosted.org/packages/e8/e4/0dbb8735407189f00b33d84122b9be52c790c7c3b25286826f4e1bdb7bde/pycurl-7.43.0.2.tar.gz\r\n    Complete output from command python setup.py egg_info:\r\n    Traceback (most recent call last):\r\n      File \"<string>\", line 1, in <module>\r\n      File \"/tmp/pip-build-jSh8ZH/pycurl/setup.py\", line 913, in <module>\r\n        ext = get_extension(sys.argv, split_extension_source=split_extension_source)\r\n      File \"/tmp/pip-build-jSh8ZH/pycurl/setup.py\", line 582, in get_extension\r\n        ext_config = ExtensionConfiguration(argv)\r\n      File \"/tmp/pip-build-jSh8ZH/pycurl/setup.py\", line 99, in __init__\r\n        self.configure()\r\n      File \"/tmp/pip-build-jSh8ZH/pycurl/setup.py\", line 227, in configure_unix\r\n        raise ConfigurationError(msg)\r\n    __main__.ConfigurationError: Could not run curl-config: [Errno 2] No such file or directory\r\n    \r\n    ----------------------------------------\r\nCommand \"python setup.py egg_info\" failed with error code 1 in /tmp/pip-build-jSh8ZH/pycurl/\r\nYou are using pip version 9.0.1, however version 18.0 is available.\r\nYou should consider upgrading via the 'pip install --upgrade pip' command.\r\n```\r\n\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n#\n# Rucio documentation build configuration file, created by\n# sphinx-quickstart on Fri Oct 27 14:25:40 2017.\n#\n# This file is execfile()d with the current directory set to its\n# containing dir.\n#\n# Note that not all possible configuration values are present in this\n# autogenerated file.\n#\n# All configuration values have a default; values that are commented out\n# serve to show the default.\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\n# sys.path.insert(0, os.path.abspath('.'))\n\nfrom mock import Mock as MagicMock\n\n\nclass Mock(MagicMock):\n    @classmethod\n    def __getattr__(cls, name):\n        return Mock()\n\n    @classmethod\n    def __getitem__(cls, name):\n        return Mock()\n\n\nMOCK_MODULES = ['pycurl']\nsys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)\n\n# -- General configuration ------------------------------------------------\n\n# If your documentation needs a minimal Sphinx version, state it here.\n#\n# needs_sphinx = '1.0'\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 = ['sphinx.ext.autodoc',\n              'sphinx.ext.doctest',\n              'sphinx.ext.todo',\n              'rucio.common.doc.argparse.ext',\n              'sphinxcontrib.httpdomain',\n              'sphinxcontrib.autohttp.flask',\n              'sphinxcontrib.autohttp.flaskqref']\n\n\non_rtd = os.environ.get('READTHEDOCS', None) == 'True'\n\nif not on_rtd:  # only import and set the theme if we're building docs locally\n    import sphinx_rtd_theme\n    html_theme = 'sphinx_rtd_theme'\n    html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]\n\n\n# Add any paths that contain templates here, relative to this directory.\ntemplates_path = ['_templates']\n\n# The suffix(es) of source filenames.\n# You can specify multiple suffix as a list of string:\n#\n# source_suffix = ['.rst', '.md']\nsource_suffix = '.rst'\n\n# The master toctree document.\nmaster_doc = 'index'\n\n# General information about the project.\nproject = u'Rucio'\ncopyright = u'2012-2018 CERN for the benefit of the ATLAS collaboration'\nauthor = u'rucio-dev@cern.ch'\n\n# The version info for the project you're documenting, acts as replacement for\n# |version| and |release|, also used in various other places throughout the\n# built documents.\n#\n# The short X.Y version.\nversion = u''\n# The full version, including alpha/beta/rc tags.\nrelease = u'1.2'\n\n# The language for content autogenerated by Sphinx. Refer to documentation\n# for a list of supported languages.\n#\n# This is also used if you do content translation via gettext catalogs.\n# Usually you set \"language\" from the command line for these cases.\nlanguage = None\n\n# List of patterns, relative to source directory, that match files and\n# directories to ignore when looking for source files.\n# This patterns also effect to html_static_path and html_extra_path\nexclude_patterns = []\n\n# The name of the Pygments (syntax highlighting) style to use.\npygments_style = 'sphinx'\n\n# If true, `todo` and `todoList` produce output, else they produce nothing.\ntodo_include_todos = True\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#\n# html_theme = 'alabaster'\n\n# Theme options are theme-specific and customize the look and feel of a theme\n# further.  For a list of options available for each theme, see the\n# documentation.\n#\n# html_theme_options = {}\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\".\n# html_static_path = ['_static']\n\n# Custom sidebar templates, must be a dictionary that maps document names\n# to template names.\n#\n# This is required for the alabaster theme\n# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars\n# html_sidebars = {\n#     '**': [\n#         'about.html',\n#         'navigation.html',\n#         'relations.html',  # needs 'show_related': True theme option to display\n#         'searchbox.html',\n#         'donate.html',\n#     ]\n# }\n\n\n# -- Options for HTMLHelp output ------------------------------------------\n\n# Output file base name for HTML help builder.\nhtmlhelp_basename = 'Ruciodoc'\n\n\n# -- Options for LaTeX output ---------------------------------------------\n\nlatex_elements = {\n    # The paper size ('letterpaper' or 'a4paper').\n    #\n    # 'papersize': 'letterpaper',\n\n    # The font size ('10pt', '11pt' or '12pt').\n    #\n    # 'pointsize': '10pt',\n\n    # Additional stuff for the LaTeX preamble.\n    #\n    # 'preamble': '',\n\n    # Latex figure (float) alignment\n    #\n    # 'figure_align': 'htbp',\n}\n\n# Grouping the document tree into LaTeX files. List of tuples\n# (source start file, target name, title,\n#  author, documentclass [howto, manual, or own class]).\nlatex_documents = [\n    (master_doc, 'Rucio.tex', u'Rucio Documentation',\n     u'rucio-dev@cern.ch', 'manual'),\n]\n\n\n# -- Options for manual page output ---------------------------------------\n\n# One entry per manual page. List of tuples\n# (source start file, name, description, authors, manual section).\nman_pages = [\n    (master_doc, 'rucio', u'Rucio Documentation',\n     [author], 1)\n]\n\n\n# -- Options for Texinfo output -------------------------------------------\n\n# Grouping the document tree into Texinfo files. List of tuples\n# (source start file, target name, title, author,\n#  dir menu entry, description, category)\ntexinfo_documents = [\n    (master_doc, 'Rucio', u'Rucio Documentation',\n     author, 'Rucio', 'One line description of project.',\n     'Miscellaneous'),\n]\n", "path": "doc/source/conf.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n#\n# Rucio documentation build configuration file, created by\n# sphinx-quickstart on Fri Oct 27 14:25:40 2017.\n#\n# This file is execfile()d with the current directory set to its\n# containing dir.\n#\n# Note that not all possible configuration values are present in this\n# autogenerated file.\n#\n# All configuration values have a default; values that are commented out\n# serve to show the default.\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\n# sys.path.insert(0, os.path.abspath('.'))\n\nfrom mock import Mock as MagicMock\n\n\nclass Mock(MagicMock):\n    @classmethod\n    def __getattr__(cls, name):\n        return Mock()\n\n    @classmethod\n    def __getitem__(cls, name):\n        return Mock()\n\n\nMOCK_MODULES = ['pycurl', 'M2Crypto']\nsys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)\n\n# -- General configuration ------------------------------------------------\n\n# If your documentation needs a minimal Sphinx version, state it here.\n#\n# needs_sphinx = '1.0'\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 = ['sphinx.ext.autodoc',\n              'sphinx.ext.doctest',\n              'sphinx.ext.todo',\n              'rucio.common.doc.argparse.ext',\n              'sphinxcontrib.httpdomain',\n              'sphinxcontrib.autohttp.flask',\n              'sphinxcontrib.autohttp.flaskqref']\n\n\non_rtd = os.environ.get('READTHEDOCS', None) == 'True'\n\nif not on_rtd:  # only import and set the theme if we're building docs locally\n    import sphinx_rtd_theme\n    html_theme = 'sphinx_rtd_theme'\n    html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]\n\n\n# Add any paths that contain templates here, relative to this directory.\ntemplates_path = ['_templates']\n\n# The suffix(es) of source filenames.\n# You can specify multiple suffix as a list of string:\n#\n# source_suffix = ['.rst', '.md']\nsource_suffix = '.rst'\n\n# The master toctree document.\nmaster_doc = 'index'\n\n# General information about the project.\nproject = u'Rucio'\ncopyright = u'2012-2018 CERN for the benefit of the ATLAS collaboration'\nauthor = u'rucio-dev@cern.ch'\n\n# The version info for the project you're documenting, acts as replacement for\n# |version| and |release|, also used in various other places throughout the\n# built documents.\n#\n# The short X.Y version.\nversion = u''\n# The full version, including alpha/beta/rc tags.\nrelease = u'1.2'\n\n# The language for content autogenerated by Sphinx. Refer to documentation\n# for a list of supported languages.\n#\n# This is also used if you do content translation via gettext catalogs.\n# Usually you set \"language\" from the command line for these cases.\nlanguage = None\n\n# List of patterns, relative to source directory, that match files and\n# directories to ignore when looking for source files.\n# This patterns also effect to html_static_path and html_extra_path\nexclude_patterns = []\n\n# The name of the Pygments (syntax highlighting) style to use.\npygments_style = 'sphinx'\n\n# If true, `todo` and `todoList` produce output, else they produce nothing.\ntodo_include_todos = True\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#\n# html_theme = 'alabaster'\n\n# Theme options are theme-specific and customize the look and feel of a theme\n# further.  For a list of options available for each theme, see the\n# documentation.\n#\n# html_theme_options = {}\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\".\n# html_static_path = ['_static']\n\n# Custom sidebar templates, must be a dictionary that maps document names\n# to template names.\n#\n# This is required for the alabaster theme\n# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars\n# html_sidebars = {\n#     '**': [\n#         'about.html',\n#         'navigation.html',\n#         'relations.html',  # needs 'show_related': True theme option to display\n#         'searchbox.html',\n#         'donate.html',\n#     ]\n# }\n\n\n# -- Options for HTMLHelp output ------------------------------------------\n\n# Output file base name for HTML help builder.\nhtmlhelp_basename = 'Ruciodoc'\n\n\n# -- Options for LaTeX output ---------------------------------------------\n\nlatex_elements = {\n    # The paper size ('letterpaper' or 'a4paper').\n    #\n    # 'papersize': 'letterpaper',\n\n    # The font size ('10pt', '11pt' or '12pt').\n    #\n    # 'pointsize': '10pt',\n\n    # Additional stuff for the LaTeX preamble.\n    #\n    # 'preamble': '',\n\n    # Latex figure (float) alignment\n    #\n    # 'figure_align': 'htbp',\n}\n\n# Grouping the document tree into LaTeX files. List of tuples\n# (source start file, target name, title,\n#  author, documentclass [howto, manual, or own class]).\nlatex_documents = [\n    (master_doc, 'Rucio.tex', u'Rucio Documentation',\n     u'rucio-dev@cern.ch', 'manual'),\n]\n\n\n# -- Options for manual page output ---------------------------------------\n\n# One entry per manual page. List of tuples\n# (source start file, name, description, authors, manual section).\nman_pages = [\n    (master_doc, 'rucio', u'Rucio Documentation',\n     [author], 1)\n]\n\n\n# -- Options for Texinfo output -------------------------------------------\n\n# Grouping the document tree into Texinfo files. List of tuples\n# (source start file, target name, title, author,\n#  dir menu entry, description, category)\ntexinfo_documents = [\n    (master_doc, 'Rucio', u'Rucio Documentation',\n     author, 'Rucio', 'One line description of project.',\n     'Miscellaneous'),\n]\n", "path": "doc/source/conf.py"}]}