【问题标题】:scrapy throw a send_catch_log_deferred exception on PyPyscrapy 在 PyPy 上抛出 send_catch_log_deferred 异常
【发布时间】:2012-11-09 09:27:52
【问题描述】:

当我在 PyPy 上使用 scrapy shell 时,它会抛出一些 Execption ,那么这个错误是什么? 这是错误信息

    % /usr/local/share/pypy/scrapy shell http://www.baidu.com             
    zsh: correct 'shell' to 'shells' [nyae]? n
    2012-11-09 16:40:06+0800 [scrapy] INFO: Scrapy 0.16.1 started (bot: scrapybot)
    2012-11-09 16:40:06+0800 [scrapy] DEBUG: Enabled extensions: TelnetConsole, WebService, CloseSpider, CoreStats, SpiderState
    2012-11-09 16:40:06+0800 [scrapy] DEBUG: Enabled downloader middlewares: HttpAuthMiddleware, DownloadTimeoutMiddleware, UserAgentMiddleware, RetryMiddleware, DefaultHeadersMiddleware, RedirectMiddleware, CookiesMiddleware, HttpCompressionMiddleware, ChunkedTransferMiddleware, DownloaderStats
    2012-11-09 16:40:06+0800 [scrapy] DEBUG: Enabled spider middlewares: HttpErrorMiddleware, OffsiteMiddleware, RefererMiddleware, UrlLengthMiddleware, DepthMiddleware
    2012-11-09 16:40:06+0800 [scrapy] DEBUG: Enabled item pipelines: 
    2012-11-09 16:40:06+0800 [scrapy] ERROR: Error caught on signal handler: <bound method instance.start_listening of <scrapy.telnet.TelnetConsole instance at 0x00000001063f0bc0>>
        Traceback (most recent call last):
          File "/usr/local/Cellar/pypy/1.9/site-packages/twisted/internet/defer.py", line 1045, in _inlineCallbacks
            result = g.send(result)
          File "/usr/local/Cellar/pypy/1.9/site-packages/scrapy/core/engine.py", line 75, in start
            yield self.signals.send_catch_log_deferred(signal=signals.engine_started)
          File "/usr/local/Cellar/pypy/1.9/site-packages/scrapy/signalmanager.py", line 23, in send_catch_log_deferred
            return signal.send_catch_log_deferred(*a, **kw)
          File "/usr/local/Cellar/pypy/1.9/site-packages/scrapy/utils/signal.py", line 53, in send_catch_log_deferred
            *arguments, **named)
        --- <exception caught here> ---
          File "/usr/local/Cellar/pypy/1.9/site-packages/twisted/internet/defer.py", line 134, in maybeDeferred
            result = f(*args, **kw)
          File "/usr/local/Cellar/pypy/1.9/site-packages/scrapy/xlib/pydispatch/robustapply.py", line 47, in robustApply
            return receiver(*arguments, **named)
        exceptions.TypeError: start_listening() got 2 unexpected keyword arguments

【问题讨论】:

    标签: scrapy pypy


    【解决方案1】:

    据我所知,scrapy 使用 lxml。只有非常新的 lxml 有效(也适用于 PyPy 主干,而不是 PyPy 1.9),我建议您尝试一下。

    【讨论】:

    • 非常感谢,不过我用python运行scrapy就可以了。所以我检查了 pip freeze 、 pypy 和 python 都使用 lxml 3.0.1 。不过我会试试的。
    猜你喜欢
    • 2015-09-10
    • 1970-01-01
    • 2013-05-24
    • 2011-05-25
    • 2015-08-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多