Scrapy, a fast high-level web crawling & scraping framework for Python.
More visible telnet conch message
Konstantin Lopuhin9428a4a3aa4c
diff --git a/scrapy/extensions/telnet.py b/scrapy/extensions/telnet.pyindex 7cc8f823a..3024ddfaa 100644--- a/scrapy/extensions/telnet.py+++ b/scrapy/extensions/telnet.py@@ -6,6 +6,7 @@ See documentation in docs/topics/telnetconsole.rstimport pprintimport logging+import tracebackfrom twisted.internet import protocoltry:@@ -13,6 +14,7 @@ try:from twisted.conch.insults import insultsTWISTED_CONCH_AVAILABLE = Trueexcept (ImportError, SyntaxError):+ _TWISTED_CONCH_TRACEBACK = traceback.format_exc()TWISTED_CONCH_AVAILABLE = Falsefrom scrapy.exceptions import NotConfigured@@ -40,8 +42,9 @@ class TelnetConsole(protocol.ServerFactory):if not crawler.settings.getbool('TELNETCONSOLE_ENABLED'):raise NotConfiguredif not TWISTED_CONCH_AVAILABLE:- raise NotConfigured('TelnetConsole not enabled: failed to import '- 'required twisted modules.')+ raise NotConfigured(+ 'TELNETCONSOLE_ENABLED setting is True but required twisted '+ 'modules failed to import:\n' + _TWISTED_CONCH_TRACEBACK)self.crawler = crawlerself.noisy = Falseself.portrange = [int(x) for x in crawler.settings.getlist('TELNETCONSOLE_PORT')]