Scrapy, a fast high-level web crawling & scraping framework for Python.
Use twisted.python.log instead of failure.printTraceback().
Andrey Rakhmatullin6428356584c0
diff --git a/tests/CrawlerProcess/asyncio_enabled_reactor_different_loop.py b/tests/CrawlerProcess/asyncio_enabled_reactor_different_loop.pyindex 6fe88b011..9dc8ce46b 100644--- a/tests/CrawlerProcess/asyncio_enabled_reactor_different_loop.py+++ b/tests/CrawlerProcess/asyncio_enabled_reactor_different_loop.py@@ -2,6 +2,7 @@ import asyncioimport sysfrom twisted.internet import asyncioreactor+from twisted.python import logif sys.version_info >= (3, 8) and sys.platform == "win32":asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())@@ -25,5 +26,5 @@ process = CrawlerProcess(})d = process.crawl(NoRequestsSpider)-d.addErrback(lambda failure: failure.printTraceback())+d.addErrback(log.err)process.start()diff --git a/tests/CrawlerProcess/reactor_default_twisted_reactor_select.py b/tests/CrawlerProcess/reactor_default_twisted_reactor_select.pyindex 091e9d424..eee808c32 100644--- a/tests/CrawlerProcess/reactor_default_twisted_reactor_select.py+++ b/tests/CrawlerProcess/reactor_default_twisted_reactor_select.py@@ -1,4 +1,5 @@from twisted.internet import reactor # noqa: F401+from twisted.python import logimport scrapyfrom scrapy.crawler import CrawlerProcess@@ -18,5 +19,5 @@ process = CrawlerProcess()d = process.crawl(NoRequestsSpider)-d.addErrback(lambda failure: failure.printTraceback())+d.addErrback(log.err)process.start()diff --git a/tests/CrawlerProcess/reactor_select_subclass_twisted_reactor_select.py b/tests/CrawlerProcess/reactor_select_subclass_twisted_reactor_select.pyindex 5615e7a68..38ca4c4f1 100644--- a/tests/CrawlerProcess/reactor_select_subclass_twisted_reactor_select.py+++ b/tests/CrawlerProcess/reactor_select_subclass_twisted_reactor_select.py@@ -1,5 +1,6 @@from twisted.internet.main import installReactorfrom twisted.internet.selectreactor import SelectReactor+from twisted.python import logimport scrapyfrom scrapy.crawler import CrawlerProcess@@ -27,5 +28,5 @@ process = CrawlerProcess()d = process.crawl(NoRequestsSpider)-d.addErrback(lambda failure: failure.printTraceback())+d.addErrback(log.err)process.start()diff --git a/tests/CrawlerProcess/twisted_reactor_custom_settings_conflict.py b/tests/CrawlerProcess/twisted_reactor_custom_settings_conflict.pyindex 7074a7389..d71014b34 100644--- a/tests/CrawlerProcess/twisted_reactor_custom_settings_conflict.py+++ b/tests/CrawlerProcess/twisted_reactor_custom_settings_conflict.py@@ -1,3 +1,5 @@+from twisted.python import log+import scrapyfrom scrapy.crawler import CrawlerProcess@@ -18,7 +20,7 @@ class AsyncioReactorSpider(scrapy.Spider):process = CrawlerProcess()d1 = process.crawl(SelectReactorSpider)-d1.addErrback(lambda failure: failure.printTraceback())+d1.addErrback(log.err)d2 = process.crawl(AsyncioReactorSpider)-d2.addErrback(lambda failure: failure.printTraceback())+d2.addErrback(log.err)process.start()