We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Request doesn't set callback to self.parse automatically when errback is set
Hi, I'm facing an `AssertionError` when set `errback`  and not `callback` in `Request`, is that expected? :

```
...
    def start_requests(self):
        yield Request(
            self.start_url,
            # callback=self.parse,
            errback=self.parse_error,
            meta={
                'dont_redirect': True,
            },
        )
...
```
trigger this : 
```
2019-01-16 15:47:22 [scrapy.core.engine] ERROR: Error while obtaining start requests
Traceback (most recent call last):
  File "/home/joaquin/Repos/example/env/lib/python3.6/site-packages/scrapy/core/engine.py", line 127, in _next_request
    request = next(slot.start_requests)
  File "/home/joaquin/Repos/example/example/spiders/br/rj/example.py", line 128, in start_requests
    'dont_redirect': True,
  File "/home/joaquin/Repos/example/env/lib/python3.6/site-packages/scrapy/http/request/__init__.py", line 34, in __init__
    assert callback or not errback, "Cannot use errback without a callback"
AssertionError: Cannot use errback without a callback
2019-01-16 15:47:22 [scrapy.core.engine] INFO: Closing spider (finished)
2019-01-16 15:47:22 [scrapy.core.engine] INFO: Spider closed (finished)
```

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `scrapy/http/request/__init__.py`
Content:
```
1 """
2 This module implements the Request class which is used to represent HTTP
3 requests in Scrapy.
4 
5 See documentation in docs/topics/request-response.rst
6 """
7 import six
8 from w3lib.url import safe_url_string
9 
10 from scrapy.http.headers import Headers
11 from scrapy.utils.python import to_bytes
12 from scrapy.utils.trackref import object_ref
13 from scrapy.utils.url import escape_ajax
14 from scrapy.http.common import obsolete_setter
15 from scrapy.utils.curl import curl_to_request_kwargs
16 
17 
18 class Request(object_ref):
19 
20     def __init__(self, url, callback=None, method='GET', headers=None, body=None,
21                  cookies=None, meta=None, encoding='utf-8', priority=0,
22                  dont_filter=False, errback=None, flags=None, cb_kwargs=None):
23 
24         self._encoding = encoding  # this one has to be set first
25         self.method = str(method).upper()
26         self._set_url(url)
27         self._set_body(body)
28         assert isinstance(priority, int), "Request priority not an integer: %r" % priority
29         self.priority = priority
30 
31         if callback is not None and not callable(callback):
32             raise TypeError('callback must be a callable, got %s' % type(callback).__name__)
33         if errback is not None and not callable(errback):
34             raise TypeError('errback must be a callable, got %s' % type(errback).__name__)
35         assert callback or not errback, "Cannot use errback without a callback"
36         self.callback = callback
37         self.errback = errback
38 
39         self.cookies = cookies or {}
40         self.headers = Headers(headers or {}, encoding=encoding)
41         self.dont_filter = dont_filter
42 
43         self._meta = dict(meta) if meta else None
44         self._cb_kwargs = dict(cb_kwargs) if cb_kwargs else None
45         self.flags = [] if flags is None else list(flags)
46 
47     @property
48     def cb_kwargs(self):
49         if self._cb_kwargs is None:
50             self._cb_kwargs = {}
51         return self._cb_kwargs
52 
53     @property
54     def meta(self):
55         if self._meta is None:
56             self._meta = {}
57         return self._meta
58 
59     def _get_url(self):
60         return self._url
61 
62     def _set_url(self, url):
63         if not isinstance(url, six.string_types):
64             raise TypeError('Request url must be str or unicode, got %s:' % type(url).__name__)
65 
66         s = safe_url_string(url, self.encoding)
67         self._url = escape_ajax(s)
68 
69         if ('://' not in self._url) and (not self._url.startswith('data:')):
70             raise ValueError('Missing scheme in request url: %s' % self._url)
71 
72     url = property(_get_url, obsolete_setter(_set_url, 'url'))
73 
74     def _get_body(self):
75         return self._body
76 
77     def _set_body(self, body):
78         if body is None:
79             self._body = b''
80         else:
81             self._body = to_bytes(body, self.encoding)
82 
83     body = property(_get_body, obsolete_setter(_set_body, 'body'))
84 
85     @property
86     def encoding(self):
87         return self._encoding
88 
89     def __str__(self):
90         return "<%s %s>" % (self.method, self.url)
91 
92     __repr__ = __str__
93 
94     def copy(self):
95         """Return a copy of this Request"""
96         return self.replace()
97 
98     def replace(self, *args, **kwargs):
99         """Create a new Request with the same attributes except for those
100         given new values.
101         """
102         for x in ['url', 'method', 'headers', 'body', 'cookies', 'meta', 'flags',
103                   'encoding', 'priority', 'dont_filter', 'callback', 'errback', 'cb_kwargs']:
104             kwargs.setdefault(x, getattr(self, x))
105         cls = kwargs.pop('cls', self.__class__)
106         return cls(*args, **kwargs)
107 
108     @classmethod
109     def from_curl(cls, curl_command, ignore_unknown_options=True, **kwargs):
110         """Create a Request object from a string containing a `cURL
111         <https://curl.haxx.se/>`_ command. It populates the HTTP method, the
112         URL, the headers, the cookies and the body. It accepts the same
113         arguments as the :class:`Request` class, taking preference and
114         overriding the values of the same arguments contained in the cURL
115         command.
116 
117         Unrecognized options are ignored by default. To raise an error when
118         finding unknown options call this method by passing
119         ``ignore_unknown_options=False``.
120 
121         .. caution:: Using :meth:`from_curl` from :class:`~scrapy.http.Request`
122                      subclasses, such as :class:`~scrapy.http.JSONRequest`, or
123                      :class:`~scrapy.http.XmlRpcRequest`, as well as having
124                      :ref:`downloader middlewares <topics-downloader-middleware>`
125                      and
126                      :ref:`spider middlewares <topics-spider-middleware>`
127                      enabled, such as
128                      :class:`~scrapy.downloadermiddlewares.defaultheaders.DefaultHeadersMiddleware`,
129                      :class:`~scrapy.downloadermiddlewares.useragent.UserAgentMiddleware`,
130                      or
131                      :class:`~scrapy.downloadermiddlewares.httpcompression.HttpCompressionMiddleware`,
132                      may modify the :class:`~scrapy.http.Request` object.
133 
134        """
135         request_kwargs = curl_to_request_kwargs(curl_command, ignore_unknown_options)
136         request_kwargs.update(kwargs)
137         return cls(**request_kwargs)
138
```
--- 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/scrapy/http/request/__init__.py b/scrapy/http/request/__init__.py
--- a/scrapy/http/request/__init__.py
+++ b/scrapy/http/request/__init__.py
@@ -32,7 +32,6 @@
             raise TypeError('callback must be a callable, got %s' % type(callback).__name__)
         if errback is not None and not callable(errback):
             raise TypeError('errback must be a callable, got %s' % type(errback).__name__)
-        assert callback or not errback, "Cannot use errback without a callback"
         self.callback = callback
         self.errback = errback

{"golden_diff": "diff --git a/scrapy/http/request/__init__.py b/scrapy/http/request/__init__.py\n--- a/scrapy/http/request/__init__.py\n+++ b/scrapy/http/request/__init__.py\n@@ -32,7 +32,6 @@\n             raise TypeError('callback must be a callable, got %s' % type(callback).__name__)\n         if errback is not None and not callable(errback):\n             raise TypeError('errback must be a callable, got %s' % type(errback).__name__)\n-        assert callback or not errback, \"Cannot use errback without a callback\"\n         self.callback = callback\n         self.errback = errback\n", "issue": "Request doesn't set callback to self.parse automatically when errback is set\nHi, I'm facing an `AssertionError` when set `errback`  and not `callback` in `Request`, is that expected? :\r\n\r\n```\r\n...\r\n    def start_requests(self):\r\n        yield Request(\r\n            self.start_url,\r\n            # callback=self.parse,\r\n            errback=self.parse_error,\r\n            meta={\r\n                'dont_redirect': True,\r\n            },\r\n        )\r\n...\r\n```\r\ntrigger this : \r\n```\r\n2019-01-16 15:47:22 [scrapy.core.engine] ERROR: Error while obtaining start requests\r\nTraceback (most recent call last):\r\n  File \"/home/joaquin/Repos/example/env/lib/python3.6/site-packages/scrapy/core/engine.py\", line 127, in _next_request\r\n    request = next(slot.start_requests)\r\n  File \"/home/joaquin/Repos/example/example/spiders/br/rj/example.py\", line 128, in start_requests\r\n    'dont_redirect': True,\r\n  File \"/home/joaquin/Repos/example/env/lib/python3.6/site-packages/scrapy/http/request/__init__.py\", line 34, in __init__\r\n    assert callback or not errback, \"Cannot use errback without a callback\"\r\nAssertionError: Cannot use errback without a callback\r\n2019-01-16 15:47:22 [scrapy.core.engine] INFO: Closing spider (finished)\r\n2019-01-16 15:47:22 [scrapy.core.engine] INFO: Spider closed (finished)\r\n```\n", "before_files": [{"content": "\"\"\"\nThis module implements the Request class which is used to represent HTTP\nrequests in Scrapy.\n\nSee documentation in docs/topics/request-response.rst\n\"\"\"\nimport six\nfrom w3lib.url import safe_url_string\n\nfrom scrapy.http.headers import Headers\nfrom scrapy.utils.python import to_bytes\nfrom scrapy.utils.trackref import object_ref\nfrom scrapy.utils.url import escape_ajax\nfrom scrapy.http.common import obsolete_setter\nfrom scrapy.utils.curl import curl_to_request_kwargs\n\n\nclass Request(object_ref):\n\n    def __init__(self, url, callback=None, method='GET', headers=None, body=None,\n                 cookies=None, meta=None, encoding='utf-8', priority=0,\n                 dont_filter=False, errback=None, flags=None, cb_kwargs=None):\n\n        self._encoding = encoding  # this one has to be set first\n        self.method = str(method).upper()\n        self._set_url(url)\n        self._set_body(body)\n        assert isinstance(priority, int), \"Request priority not an integer: %r\" % priority\n        self.priority = priority\n\n        if callback is not None and not callable(callback):\n            raise TypeError('callback must be a callable, got %s' % type(callback).__name__)\n        if errback is not None and not callable(errback):\n            raise TypeError('errback must be a callable, got %s' % type(errback).__name__)\n        assert callback or not errback, \"Cannot use errback without a callback\"\n        self.callback = callback\n        self.errback = errback\n\n        self.cookies = cookies or {}\n        self.headers = Headers(headers or {}, encoding=encoding)\n        self.dont_filter = dont_filter\n\n        self._meta = dict(meta) if meta else None\n        self._cb_kwargs = dict(cb_kwargs) if cb_kwargs else None\n        self.flags = [] if flags is None else list(flags)\n\n    @property\n    def cb_kwargs(self):\n        if self._cb_kwargs is None:\n            self._cb_kwargs = {}\n        return self._cb_kwargs\n\n    @property\n    def meta(self):\n        if self._meta is None:\n            self._meta = {}\n        return self._meta\n\n    def _get_url(self):\n        return self._url\n\n    def _set_url(self, url):\n        if not isinstance(url, six.string_types):\n            raise TypeError('Request url must be str or unicode, got %s:' % type(url).__name__)\n\n        s = safe_url_string(url, self.encoding)\n        self._url = escape_ajax(s)\n\n        if ('://' not in self._url) and (not self._url.startswith('data:')):\n            raise ValueError('Missing scheme in request url: %s' % self._url)\n\n    url = property(_get_url, obsolete_setter(_set_url, 'url'))\n\n    def _get_body(self):\n        return self._body\n\n    def _set_body(self, body):\n        if body is None:\n            self._body = b''\n        else:\n            self._body = to_bytes(body, self.encoding)\n\n    body = property(_get_body, obsolete_setter(_set_body, 'body'))\n\n    @property\n    def encoding(self):\n        return self._encoding\n\n    def __str__(self):\n        return \"<%s %s>\" % (self.method, self.url)\n\n    __repr__ = __str__\n\n    def copy(self):\n        \"\"\"Return a copy of this Request\"\"\"\n        return self.replace()\n\n    def replace(self, *args, **kwargs):\n        \"\"\"Create a new Request with the same attributes except for those\n        given new values.\n        \"\"\"\n        for x in ['url', 'method', 'headers', 'body', 'cookies', 'meta', 'flags',\n                  'encoding', 'priority', 'dont_filter', 'callback', 'errback', 'cb_kwargs']:\n            kwargs.setdefault(x, getattr(self, x))\n        cls = kwargs.pop('cls', self.__class__)\n        return cls(*args, **kwargs)\n\n    @classmethod\n    def from_curl(cls, curl_command, ignore_unknown_options=True, **kwargs):\n        \"\"\"Create a Request object from a string containing a `cURL\n        <https://curl.haxx.se/>`_ command. It populates the HTTP method, the\n        URL, the headers, the cookies and the body. It accepts the same\n        arguments as the :class:`Request` class, taking preference and\n        overriding the values of the same arguments contained in the cURL\n        command.\n\n        Unrecognized options are ignored by default. To raise an error when\n        finding unknown options call this method by passing\n        ``ignore_unknown_options=False``.\n\n        .. caution:: Using :meth:`from_curl` from :class:`~scrapy.http.Request`\n                     subclasses, such as :class:`~scrapy.http.JSONRequest`, or\n                     :class:`~scrapy.http.XmlRpcRequest`, as well as having\n                     :ref:`downloader middlewares <topics-downloader-middleware>`\n                     and\n                     :ref:`spider middlewares <topics-spider-middleware>`\n                     enabled, such as\n                     :class:`~scrapy.downloadermiddlewares.defaultheaders.DefaultHeadersMiddleware`,\n                     :class:`~scrapy.downloadermiddlewares.useragent.UserAgentMiddleware`,\n                     or\n                     :class:`~scrapy.downloadermiddlewares.httpcompression.HttpCompressionMiddleware`,\n                     may modify the :class:`~scrapy.http.Request` object.\n\n       \"\"\"\n        request_kwargs = curl_to_request_kwargs(curl_command, ignore_unknown_options)\n        request_kwargs.update(kwargs)\n        return cls(**request_kwargs)\n", "path": "scrapy/http/request/__init__.py"}], "after_files": [{"content": "\"\"\"\nThis module implements the Request class which is used to represent HTTP\nrequests in Scrapy.\n\nSee documentation in docs/topics/request-response.rst\n\"\"\"\nimport six\nfrom w3lib.url import safe_url_string\n\nfrom scrapy.http.headers import Headers\nfrom scrapy.utils.python import to_bytes\nfrom scrapy.utils.trackref import object_ref\nfrom scrapy.utils.url import escape_ajax\nfrom scrapy.http.common import obsolete_setter\nfrom scrapy.utils.curl import curl_to_request_kwargs\n\n\nclass Request(object_ref):\n\n    def __init__(self, url, callback=None, method='GET', headers=None, body=None,\n                 cookies=None, meta=None, encoding='utf-8', priority=0,\n                 dont_filter=False, errback=None, flags=None, cb_kwargs=None):\n\n        self._encoding = encoding  # this one has to be set first\n        self.method = str(method).upper()\n        self._set_url(url)\n        self._set_body(body)\n        assert isinstance(priority, int), \"Request priority not an integer: %r\" % priority\n        self.priority = priority\n\n        if callback is not None and not callable(callback):\n            raise TypeError('callback must be a callable, got %s' % type(callback).__name__)\n        if errback is not None and not callable(errback):\n            raise TypeError('errback must be a callable, got %s' % type(errback).__name__)\n        self.callback = callback\n        self.errback = errback\n\n        self.cookies = cookies or {}\n        self.headers = Headers(headers or {}, encoding=encoding)\n        self.dont_filter = dont_filter\n\n        self._meta = dict(meta) if meta else None\n        self._cb_kwargs = dict(cb_kwargs) if cb_kwargs else None\n        self.flags = [] if flags is None else list(flags)\n\n    @property\n    def cb_kwargs(self):\n        if self._cb_kwargs is None:\n            self._cb_kwargs = {}\n        return self._cb_kwargs\n\n    @property\n    def meta(self):\n        if self._meta is None:\n            self._meta = {}\n        return self._meta\n\n    def _get_url(self):\n        return self._url\n\n    def _set_url(self, url):\n        if not isinstance(url, six.string_types):\n            raise TypeError('Request url must be str or unicode, got %s:' % type(url).__name__)\n\n        s = safe_url_string(url, self.encoding)\n        self._url = escape_ajax(s)\n\n        if ('://' not in self._url) and (not self._url.startswith('data:')):\n            raise ValueError('Missing scheme in request url: %s' % self._url)\n\n    url = property(_get_url, obsolete_setter(_set_url, 'url'))\n\n    def _get_body(self):\n        return self._body\n\n    def _set_body(self, body):\n        if body is None:\n            self._body = b''\n        else:\n            self._body = to_bytes(body, self.encoding)\n\n    body = property(_get_body, obsolete_setter(_set_body, 'body'))\n\n    @property\n    def encoding(self):\n        return self._encoding\n\n    def __str__(self):\n        return \"<%s %s>\" % (self.method, self.url)\n\n    __repr__ = __str__\n\n    def copy(self):\n        \"\"\"Return a copy of this Request\"\"\"\n        return self.replace()\n\n    def replace(self, *args, **kwargs):\n        \"\"\"Create a new Request with the same attributes except for those\n        given new values.\n        \"\"\"\n        for x in ['url', 'method', 'headers', 'body', 'cookies', 'meta', 'flags',\n                  'encoding', 'priority', 'dont_filter', 'callback', 'errback', 'cb_kwargs']:\n            kwargs.setdefault(x, getattr(self, x))\n        cls = kwargs.pop('cls', self.__class__)\n        return cls(*args, **kwargs)\n\n    @classmethod\n    def from_curl(cls, curl_command, ignore_unknown_options=True, **kwargs):\n        \"\"\"Create a Request object from a string containing a `cURL\n        <https://curl.haxx.se/>`_ command. It populates the HTTP method, the\n        URL, the headers, the cookies and the body. It accepts the same\n        arguments as the :class:`Request` class, taking preference and\n        overriding the values of the same arguments contained in the cURL\n        command.\n\n        Unrecognized options are ignored by default. To raise an error when\n        finding unknown options call this method by passing\n        ``ignore_unknown_options=False``.\n\n        .. caution:: Using :meth:`from_curl` from :class:`~scrapy.http.Request`\n                     subclasses, such as :class:`~scrapy.http.JSONRequest`, or\n                     :class:`~scrapy.http.XmlRpcRequest`, as well as having\n                     :ref:`downloader middlewares <topics-downloader-middleware>`\n                     and\n                     :ref:`spider middlewares <topics-spider-middleware>`\n                     enabled, such as\n                     :class:`~scrapy.downloadermiddlewares.defaultheaders.DefaultHeadersMiddleware`,\n                     :class:`~scrapy.downloadermiddlewares.useragent.UserAgentMiddleware`,\n                     or\n                     :class:`~scrapy.downloadermiddlewares.httpcompression.HttpCompressionMiddleware`,\n                     may modify the :class:`~scrapy.http.Request` object.\n\n       \"\"\"\n        request_kwargs = curl_to_request_kwargs(curl_command, ignore_unknown_options)\n        request_kwargs.update(kwargs)\n        return cls(**request_kwargs)\n", "path": "scrapy/http/request/__init__.py"}]}