导致未处理错误的子流程错误

时间:2019-06-12 11:15:08

标签: python subprocess

我正在从https://github.com/fhamborg/news-please/blob/master/newsplease/__main__.py的{​​{1}}运行新闻请求项目

subprocess

我遇到此错误

         cmd = ["python",r"/media/dhruvagupta/F428F6FA28F6BB26/backup dhruva/python/New folder/training/news-please-master/news-please-master/newsplease/__main__.py","-c /newsplease/config/"]
        j = psutil.Popen(cmd)

和另一个错误

            Unhandled Error
Traceback (most recent call last):
  File "/media/dhruvagupta/F428F6FA28F6BB26/backup dhruva/python/New folder/training/news-please-master/news-please-master/newsplease/single_crawler.py", line 152, in __init__
    self.process.start()
  File "/home/dhruvagupta/.local/lib/python2.7/site-packages/scrapy/crawler.py", line 293, in start
    reactor.run(installSignalHandlers=False)  # blocking call
  File "/home/dhruvagupta/.local/lib/python2.7/site-packages/twisted/internet/base.py", line 1272, in run
    self.mainLoop()
  File "/home/dhruvagupta/.local/lib/python2.7/site-packages/twisted/internet/base.py", line 1281, in mainLoop
    self.runUntilCurrent()
--- <exception caught here> ---
  File "/home/dhruvagupta/.local/lib/python2.7/site-packages/twisted/internet/base.py", line 902, in runUntilCurrent
    call.func(*call.args, **call.kw)
  File "/home/dhruvagupta/.local/lib/python2.7/site-packages/scrapy/utils/reactor.py", line 41, in __call__
    return self._func(*self._a, **self._kw)
  File "/home/dhruvagupta/.local/lib/python2.7/site-packages/scrapy/core/engine.py", line 122, in _next_request
    if not self._next_request_from_scheduler(spider):
  File "/home/dhruvagupta/.local/lib/python2.7/site-packages/scrapy/core/engine.py", line 149, in _next_request_from_scheduler
    request = slot.scheduler.next_request()
  File "/home/dhruvagupta/.local/lib/python2.7/site-packages/scrapy/core/scheduler.py", line 71, in next_request
    request = self._dqpop()
  File "/home/dhruvagupta/.local/lib/python2.7/site-packages/scrapy/core/scheduler.py", line 106, in _dqpop
    d = self.dqs.pop()
  File "/home/dhruvagupta/.local/lib/python2.7/site-packages/queuelib/pqueue.py", line 43, in pop
    m = q.pop()
  File "/home/dhruvagupta/.local/lib/python2.7/site-packages/scrapy/squeues.py", line 19, in pop
    s = super(SerializableQueue, self).pop()
  File "/home/dhruvagupta/.local/lib/python2.7/site-packages/queuelib/queue.py", line 161, in pop
    size, = struct.unpack(self.SIZE_FORMAT, self.f.read())
struct.error: unpack requires a string argument of length 4

0 个答案:

没有答案