• scrapy 'TelnetConsole' object has no attribute 'port'报错


    (crawl_scrapy) D:ProjectPythonProjectcrawlscrapymyspider>scrapy crawl itcast
    2020-07-02 18:26:02 [scrapy.utils.signal] ERROR: Error caught on signal handler: <bound method
    TelnetConsole.start_listening of <scrapy.extensions.telnet.TelnetConsole object at 0x0000026FB7
    8D8FA0>>
    Traceback (most recent call last):
      File "f:pyenvscrawl_scrapylibsite-packagesscrapyutilsdefer.py", line 164, in maybeDefe
    rred_coro
        result = f(*args, **kw)
      File "f:pyenvscrawl_scrapylibsite-packagespydispatch
    obustapply.py", line 55, in robust
    Apply
        return receiver(*arguments, **named)
      File "f:pyenvscrawl_scrapylibsite-packagesscrapyextensions	elnet.py", line 65, in star
    t_listening
        self.port = listen_tcp(self.portrange, self.host, self)
      File "f:pyenvscrawl_scrapylibsite-packagesscrapyutils
    eactor.py", line 22, in listen_t
    cp
        return reactor.listenTCP(x, factory, interface=host)
      File "f:pyenvscrawl_scrapylibsite-packages	wistedinternetposixbase.py", line 495, in l
    istenTCP
        p.startListening()
      File "f:pyenvscrawl_scrapylibsite-packages	wistedinternet	cp.py", line 1356, in startL
    istening
        skt = self.createInternetSocket()
      File "f:pyenvscrawl_scrapylibsite-packages	wistedinternet	cp.py", line 1340, in create
    InternetSocket
        s = base.BasePort.createInternetSocket(self)
      File "f:pyenvscrawl_scrapylibsite-packages	wistedinternetase.py", line 1201, in creat
    eInternetSocket
        fdesc._setCloseOnExec(s.fileno())
      File "f:pyenvscrawl_scrapylibsite-packages	wistedinternetfdesc.py", line 48, in _setCl
    oseOnExec
        flags = fcntl.fcntl(fd, fcntl.F_GETFD)
    AttributeError: module 'fcntl' has no attribute 'F_GETFD'
    2020-07-02 18:26:03 [scrapy.downloadermiddlewares.robotstxt] ERROR: Error downloading <GET http
    ://www.itcast.cn/robots.txt>: module 'fcntl' has no attribute 'F_GETFD'
    Traceback (most recent call last):
      File "f:pyenvscrawl_scrapylibsite-packagesscrapycoredownloadermiddleware.py", line 44
    , in process_request
        return (yield download_func(request=request, spider=spider))
      File "f:pyenvscrawl_scrapylibsite-packages	wistedinternetendpoints.py", line 578, in c
    onnect
        self._reactor.connectTCP(
      File "f:pyenvscrawl_scrapylibsite-packages	wistedinternetposixbase.py", line 500, in c
    onnectTCP
        c.connect()
      File "f:pyenvscrawl_scrapylibsite-packages	wistedinternetase.py", line 1132, in conne
    ct
        self.transport = transport = self._makeTransport()
      File "f:pyenvscrawl_scrapylibsite-packages	wistedinternet	cp.py", line 1548, in _makeT
    ransport
        return Client(self.host, self.port, self.bindAddress, self, self.reactor)
      File "f:pyenvscrawl_scrapylibsite-packages	wistedinternet	cp.py", line 736, in __init_
    _
        skt = self.createInternetSocket()
      File "f:pyenvscrawl_scrapylibsite-packages	wistedinternet	cp.py", line 572, in createI
    nternetSocket
        fdesc._setCloseOnExec(s.fileno())
      File "f:pyenvscrawl_scrapylibsite-packages	wistedinternetfdesc.py", line 48, in _setCl
    oseOnExec
        flags = fcntl.fcntl(fd, fcntl.F_GETFD)
    AttributeError: module 'fcntl' has no attribute 'F_GETFD'
    2020-07-02 18:26:03 [scrapy.core.scraper] ERROR: Error downloading <GET http://www.itcast.cn/ch
    annel/teacher.shtml>
    AttributeError: module 'fcntl' has no attribute 'F_GETFD'
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "f:pyenvscrawl_scrapylibsite-packagesscrapycoredownloadermiddleware.py", line 44
    , in process_request
        return (yield download_func(request=request, spider=spider))
      File "f:pyenvscrawl_scrapylibsite-packages	wistedinternetendpoints.py", line 578, in c
    onnect
        self._reactor.connectTCP(
      File "f:pyenvscrawl_scrapylibsite-packages	wistedinternetposixbase.py", line 500, in c
    onnectTCP
        c.connect()
      File "f:pyenvscrawl_scrapylibsite-packages	wistedinternetase.py", line 1132, in conne
    ct
        self.transport = transport = self._makeTransport()
      File "f:pyenvscrawl_scrapylibsite-packages	wistedinternet	cp.py", line 1548, in _makeT

    一定要从头看错误日志,从根源上解决。我的是把python下的libfcntl.py删除

  • 相关阅读:
    spring学习10-AOP
    spring学习9-代理模式
    spring学习6-bean的自动装配
    PyQT5使用心得
    Python 时间戳和日期相互转换
    requests模块的入门使用
    Celery异步任务
    MySQL和python交互
    MySQL高级
    MySQL中select的使用
  • 原文地址:https://www.cnblogs.com/King-boy/p/13226370.html
Copyright © 2020-2023  润新知