Skip to content

Commit

Permalink
Note about keyword-only fail parameter in StopDownload docs
Browse files Browse the repository at this point in the history
  • Loading branch information
elacuesta committed May 20, 2020
1 parent 35ffa3f commit f6e7a22
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions docs/topics/exceptions.rst
Expand Up @@ -97,13 +97,15 @@ response:

* If ``fail=False``, the request callback is called instead.

Note that ``fail`` is a keyword-only parameter.

In both cases, the response could have its body truncated: the body contains
all bytes received up until the exception is raised, including the bytes
received in the signal handler that raises the exception. Also, the response
object is marked with ``"download_stopped"`` in its :attr:`Response.flags`
received in the signal handler that raises the exception. Also, the response
object is marked with ``"download_stopped"`` in its :attr:`Response.flags`
attribute.

.. note:: ``fail`` is a keyword-only parameter, i.e. raising
``StopDownload(False)`` or ``StopDownload(True)`` will raise
a :class:`TypeError`.

See the documentation for the :class:`~scrapy.signals.bytes_received` signal
and the :ref:`topics-stop-response-download` topic for additional information and examples.

0 comments on commit f6e7a22

Please sign in to comment.