Skip to content

bug python - logger not defined

When crawling the website http://dragontech.sourceforge.net/, I go exception about a logger not defined.

Here comes the stacktrace:

Traceback (most recent call last):
  File "/home/damien/proj/crowl/crowl/pipelines.py", line 59, in process_item
    yield self.db.runInteraction(self._process_item, item)
  File "/home/damien/proj/crowl/crowl/env/lib/python3.5/site-packages/twisted/python/threadpool.py", line 250, in inContext
    result = inContext.theWork()
  File "/home/damien/proj/crowl/crowl/env/lib/python3.5/site-packages/twisted/python/threadpool.py", line 266, in <lambda>
    inContext.theWork = lambda: context.call(ctx, func, *args, **kw)
  File "/home/damien/proj/crowl/crowl/env/lib/python3.5/site-packages/twisted/python/context.py", line 122, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/home/damien/proj/crowl/crowl/env/lib/python3.5/site-packages/twisted/python/context.py", line 85, in callWithContext
    return func(*args,**kw)
  File "/home/damien/proj/crowl/crowl/env/lib/python3.5/site-packages/twisted/enterprise/adbapi.py", line 477, in _runInteraction
    compat.reraise(excValue, excTraceback)
  File "/home/damien/proj/crowl/crowl/env/lib/python3.5/site-packages/twisted/python/compat.py", line 463, in reraise
    raise exception.with_traceback(traceback)
  File "/home/damien/proj/crowl/crowl/env/lib/python3.5/site-packages/twisted/enterprise/adbapi.py", line 467, in _runInteraction
    result = interaction(trans, *args, **kw)
  File "/home/damien/proj/crowl/crowl/pipelines.py", line 128, in _process_item
    logger.error("SQL: %s", sql)
NameError: name 'logger' is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/damien/proj/crowl/crowl/env/lib/python3.5/site-packages/twisted/internet/defer.py", line 1384, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/home/damien/proj/crowl/crowl/env/lib/python3.5/site-packages/twisted/python/failure.py", line 422, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/home/damien/proj/crowl/crowl/pipelines.py", line 73, in process_item
    logger.exception('%s', pprint.pformat(item))
NameError: name 'logger' is not defined
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information