Scrapy, a fast high-level web crawling & scraping framework for Python.
Merge pull request #4188 from elacuesta/logformatter-error-formatting
Andrey Rahmatullinf558df255896
diff --cc scrapy/core/scraper.pyindex facbd8b73,427969f30..7b62068f5--- a/scrapy/core/scraper.py+++ b/scrapy/core/scraper.py@@@ -16,9 -16,8 +16,9 @@@ from scrapy import signalfrom scrapy.http import Request, Responsefrom scrapy.item import BaseItemfrom scrapy.core.spidermw import SpiderMiddlewareManager- from scrapy.utils.request import referer_str++logger = logging.getLogger(__name__)diff --cc tests/test_logformatter.pyindex 7d8c6ec7f,697ac1d15..bf9fbe5e4--- a/tests/test_logformatter.py+++ b/tests/test_logformatter.py@@@ -2,7 -2,9 +2,8 @@@ import unittesfrom testfixtures import LogCapturefrom twisted.internet import defer+ from twisted.python.failure import Failurefrom twisted.trial.unittest import TestCase as TwistedTestCase-import sixfrom scrapy.crawler import CrawlerRunnerfrom scrapy.exceptions import DropItem@@@ -59,10 -61,10 +60,10 @@@ class LogFormatterTestCase(unittest.Teslogkws = self.formatter.dropped(item, exception, response, self.spider)logline = logkws['msg'] % logkws['args']lines = logline.splitlines()- assert all(isinstance(x, six.text_type) for x in lines)+ assert all(isinstance(x, str) for x in lines)self.assertEqual(lines, [u"Dropped: \u2018", '{}'])- def test_error(self):+ def test_item_error(self):# In practice, the complete traceback is shown by passing the# 'exc_info' argument to the logging functionitem = {'key': 'value'}