Scrapy, a fast high-level web crawling & scraping framework for Python.
Go to file
Victor Torres f4f2b1695c Fix a memory leak on the Media Pipeline (Files and Images) (#3813)
We're storing exceptions captured by Twisted on the media pipeline
cache, but we're also using the defer.returnValue method with our
own methods decorated with @defer.inlineCallbacks.

The defer.returnValue method passes returned values forward by
throwing a defer._DefGen_Return exception, which in its turn
extends the BaseException class and is captured by Twisted.

This way, the latest exception stored in the Failure's object may
also have an HtmlResponse object in its __context__ attribute. As
the Response object also keeps track of the Request object that
has originated it, you could figure it out how many RAM we're
wasting here.

This could easily lead to a Memory Leak problem when running
spiders with Media Pipeline enabled and a particular Request set
that tends to raise a significant number of exceptions.

Example triggers:
- media requests with 404 status responses
- user land exceptins coming from custom middlewares
- etc.
2019-06-24 12:38:05 +02:00
artwork Use https for external links wherever possible in docs 2017-10-26 23:33:45 +05:30
debian Use https links wherever possible 2017-10-28 16:24:40 +05:30
docs Merge pull request #3739 from Matthijsy/feature/scrapy_check_env 2019-06-13 19:43:01 -03:00
extras Use https for external links wherever possible in docs 2017-10-26 23:33:45 +05:30
scrapy Fix a memory leak on the Media Pipeline (Files and Images) (#3813) 2019-06-24 12:38:05 +02:00
sep Merge branch 'master' into backward 2019-03-14 22:21:09 +05:00
tests Fix a memory leak on the Media Pipeline (Files and Images) (#3813) 2019-06-24 12:38:05 +02:00
.bumpversion.cfg Bump version: 1.5.0 → 1.6.0 2019-01-30 18:00:40 -03:00
.coveragerc remove ancient modules kept only for error messages 2018-07-06 03:23:37 +05:00
.gitignore remove duplicated entry in gitignore 2019-03-22 18:56:25 +01:00
.travis.yml Needs to be installed within tox env 2019-03-22 15:40:36 +03:00
AUTHORS added Nicolas Ramirez to AUTHORS 2013-03-14 12:44:39 -03:00
CODE_OF_CONDUCT.md minor grammatical fixes in CODE_OF_CONDUCT.md 2018-06-01 21:48:43 -03:00
CONTRIBUTING.md Be consistent with domain used for links to documentation website 2019-01-31 01:28:53 -03:00
INSTALL Be consistent with domain used for links to documentation website 2019-01-31 01:28:53 -03:00
LICENSE added oxford commas to LICENSE 2018-06-01 21:48:43 -03:00
MANIFEST.in Include additional files in sdists 2018-11-16 13:38:19 -05:00
Makefile.buildbot Generated version as pep440 and dpkg compatible 2015-06-16 00:16:09 +00:00
NEWS added NEWS file pointing to docs/news.rst 2012-04-28 23:32:51 -03:00
README.rst Be consistent with domain used for links to documentation website 2019-01-31 01:28:53 -03:00
appveyor.yml Set the cloned directory as PYTHONPATH in appveyor.yml 2019-06-11 15:56:27 +02:00
codecov.yml codecov config: disable project check, tweak PR comments 2017-05-19 00:01:27 +05:00
conftest.py remove ancient modules kept only for error messages 2018-07-06 03:23:37 +05:00
pytest.ini Don't collect tests by their class name 2015-05-04 18:10:04 -03:00
requirements-py2.txt require parsel 1.5+ 2018-09-12 17:57:27 +05:00
requirements-py3.txt require parsel 1.5+ 2018-09-12 17:57:27 +05:00
setup.cfg Build universal wheels 2016-03-01 11:00:20 +01:00
setup.py Require Twisted<=19.2.0 for Python 3.4 2019-06-11 14:11:38 +02:00
tox.ini Add a Sphinx extension to generate documentation coverage information 2019-06-04 15:03:25 +02:00

README.rst

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> </head>

Scrapy

Overview

Scrapy is a fast high-level web crawling and web scraping framework, used to crawl websites and extract structured data from their pages. It can be used for a wide range of purposes, from data mining to monitoring and automated testing.

For more information including a list of features check the Scrapy homepage at: https://scrapy.org

Requirements

  • Python 2.7 or Python 3.4+
  • Works on Linux, Windows, Mac OSX, BSD

Install

The quick way:

pip install scrapy

For more details see the install section in the documentation: https://docs.scrapy.org/en/latest/intro/install.html

Documentation

Documentation is available online at https://docs.scrapy.org/ and in the docs directory.

Releases

You can find release notes at https://docs.scrapy.org/en/latest/news.html

Community (blog, twitter, mail list, IRC)

See https://scrapy.org/community/

Contributing

See https://docs.scrapy.org/en/master/contributing.html

Code of Conduct

Please note that this project is released with a Contributor Code of Conduct (see https://github.com/scrapy/scrapy/blob/master/CODE_OF_CONDUCT.md).

By participating in this project you agree to abide by its terms. Please report unacceptable behavior to opensource@scrapinghub.com.

Companies using Scrapy

See https://scrapy.org/companies/

Commercial Support

See https://scrapy.org/support/

</html>