Commit Graph

4361 Commits

Author SHA1 Message Date
Mikhail Korobov 9aec7856b0
Merge pull request #3794 from csalazar/whitelist-form-methods-in-fromresponse
[MRG+1] Fix form methods in FormRequest.from_response (#3777)
2019-07-02 20:08:14 +05:00
Claudio Salazar 2e4dc20393 Add backward compability when method=None in FormRequest 2019-06-26 21:36:28 +02:00
Eugenio Lacuesta 428309ba1a Merge remote-tracking branch 'origin/master' into callback_kwargs 2019-06-26 11:03:31 -03:00
Mikhail Korobov c81d120bde
Merge pull request #3768 from Gallaecio/meta-ignore-tags
Implement the METAREFRESH_IGNORE_TAGS setting
2019-06-25 23:25:58 +03:00
Adrián Chaves d7795484dc Document scrapy.crawler.Crawler.stop() 2019-06-25 17:29:49 +02:00
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
Daniel Graña b53ff59a22
Merge pull request #3790 from andrewbaxter/master
[MRG+1] Account for mangling when serializing requests with private callbacks
2019-06-17 12:33:21 -03:00
Daniel Graña cdfb20aee8
Merge pull request #3739 from Matthijsy/feature/scrapy_check_env
[MRG+1] Add SCRAPY_CHECK environment variable
2019-06-13 19:43:01 -03:00
Daniel Graña 296429669f
Merge pull request #3792 from barraponto/patch-4
[MRG+1] Add 429 to RETRY_HTTP_CODES
2019-06-13 17:17:08 -03:00
sortafreel a1bca6a8e7 Add tests. 2019-06-11 07:36:29 +03:00
Sortafreel 754f52b027 Preprocess values if item built from dict.
https://github.com/scrapy/scrapy/issues/3804
2019-06-07 03:20:45 +03:00
Sortafreel bd8a10384b Add values (if there're any) when initiating items from dicts
https://github.com/scrapy/scrapy/issues/3804
2019-06-07 01:50:03 +03:00
Claudio Salazar 0c50879568 Change behavior to use method GET when there are unknown methods
in the form
2019-06-06 22:10:59 +02:00
Andrew Baxter 9c81721c40 Add tests for private method name mangling 2019-06-05 23:43:56 +09:00
Andrew Baxter bcad8947e8 Support inherited private method names 2019-06-03 20:41:02 +09:00
Andrew Baxter 9af91a26b0 Replace regex usage 2019-05-28 01:40:26 +09:00
Andrew Baxter 72b7d3e90a Make the regex align to the spec better; add unit tests for name variations 2019-05-27 23:30:23 +09:00
Claudio Salazar 461682fc3d Whitelist form methods in FormRequest.from_response method 2019-05-25 11:01:19 +02:00
Andrew Baxter 144afcee79 Use regex to check for private methods 2019-05-25 00:52:00 +09:00
Capi Etheriel 0ee2284fcc
Add 429 to RETRY_HTTP_CODES 2019-05-24 11:11:15 -03:00
Andrew Baxter e667ca7682 Account for mangling when serializing requests with private callbacks 2019-05-24 21:45:53 +09:00
Adrián Chaves 611249bb7f Implement the METAREFRESH_IGNORE_TAGS setting 2019-05-08 12:52:29 +02:00
Matthijs Vos f6485e6697 Restore alphabetic order and two lines between import and code 2019-05-03 13:55:18 +02:00
Matthijs Vos 7809c0b14e Revert another non-change comment 2019-04-20 09:25:01 +02:00
Matthijs Vos 935387aaea Revert some non-changes 2019-04-18 22:10:23 +02:00
Mikhail Korobov 4b791274d6
Merge pull request #3735 from anubhavp28/smallfix
[MRG+1] Changes a parameter name in class `DummyPolicy`
2019-04-13 01:52:22 +05:00
Mikhail Korobov 71cfe550fb
Merge pull request #3737 from anubhavp28/anothersmallfix
[MRG+1] Fixes a link in comment
2019-04-13 01:50:19 +05:00
Matthijs Vos 07adca34e1 Fix 'Too many values to unpack' 2019-04-10 13:01:46 +02:00
Matthijs Vos 50730ed228 Try it with a string 2019-04-10 13:01:01 +02:00
Matthijs Vos d27c2c68ba Wrap scrapy check in environment 2019-04-10 12:56:50 +02:00
Anubhav Patel 4cfdc14974 fixes a link in comment 2019-04-09 17:52:02 +05:30
Anubhav Patel e6048d55f9 changes parameter name 2019-04-09 17:34:20 +05:30
Mikhail Korobov 9280185054
Merge pull request #3520 from whalebot-helmsman/round-robin-scheduler-tested
[MRG+1] Downloader-aware Priority Queue for Scrapy
2019-04-07 00:06:08 +05:00
Maram Sumanth aa46e1995c [MRG+1] Show elapsed time in statscollector (#3638)
* Update corestats.py

* Update corestats.py

* corrected tests

* Update corestats.py

* Update scrapy/extensions/corestats.py
2019-04-07 00:03:40 +05:00
Mikhail Korobov f816375df5
Merge pull request #3726 from ankostis/fixctrlc
[MRG+1] fix: do not catch system exceptions like KeyboardInterrupt
2019-04-06 23:54:15 +05:00
Victor Torres 35ce92a419 fix typo (Response -> Request)
check docs for more information b5c552d17f/docs/topics/spider-middleware.rst
2019-04-05 14:31:15 -03:00
Kostis Anagnostopoulos 3a493b6066 fix: do not catch system exceptions like KeyboardInterrupt 2019-04-05 11:52:00 +02:00
Adrián Chaves 7acf4eec79 Deprecate the scrapy.utils.gz.is_gzipped function 2019-04-02 18:36:03 +02:00
Konstantin Lopuhin b5c552d17f
Merge pull request #2061 from elacuesta/process_spider_exception_generator
[MRG+1] process_spider_exception on generators
2019-04-01 10:43:19 +03:00
Eugenio Lacuesta 0522fe35c3 parse command: improve option description 2019-03-29 16:15:34 -03:00
Eugenio Lacuesta f5e0b6b89a parse command: rename cb_kwargs option to cbkwargs 2019-03-29 14:03:26 -03:00
Vostretsov Nikita f08f841d0b remove small single use method 2019-03-29 10:35:49 +00:00
Vostretsov Nikita 554d872822 remove spacing 2019-03-29 10:31:15 +00:00
Vostretsov Nikita 2b4bcfaf49 remove comment 2019-03-29 10:30:26 +00:00
Eugenio Lacuesta e8af6331b5 Add cb_kwargs option to the parse command 2019-03-28 15:03:40 -03:00
Mikhail Korobov ec719f55e7
Merge pull request #3682 from elacuesta/rule_process_request_response_parameter
[MRG+1] Rule.process_request: access Response object
2019-03-28 01:39:54 +05:00
Eugenio Lacuesta c43a23152b Merge remote-tracking branch 'upstream/master' into callback_kwargs 2019-03-27 14:42:41 -03:00
Maram Sumanth 2fd8b7c28c [MRG+1] redirect_reasons in Request.meta (#3687) 2019-03-27 00:15:53 +05:00
Vostretsov Nikita 103fdc40c1 Merge remote-tracking branch 'upstream/master' into round-robin-scheduler-tested 2019-03-25 16:16:42 +03:00
Lucy Wang df574de8cc improve tests and fix some lint warnings (#6)
* refactor downloader-aware test cases

* fix lint

* add doctest for _path_safe

* remove unused code

* better doctest
2019-03-25 16:08:40 +03:00