Parsely / pykafka

Apache Kafka client for Python; high-level & low-level consumer/producer, with great performance.
http://pykafka.readthedocs.org/
Apache License 2.0
1.12k stars 232 forks source link

logging when log doesn't exists :bug in old release #863

Open vijuSR opened 5 years ago

vijuSR commented 5 years ago

Noticed the following exception:

Exception ignored in: <bound method RequestHandler.__del__ of <pykafka.handlers.RequestHandler object at 0x00000050FD225 828>> Traceback (most recent call last): File "G:\VENVIRONMENT\granular\lib\site-packages\pykafka\handlers.py", line 164, in __del__ File "G:\VENVIRONMENT\granular\lib\site-packages\pykafka\handlers.py", line 189, in stop File "C:\Python36\lib\logging\__init__.py", line 1306, in info File "C:\Python36\lib\logging\__init__.py", line 1442, in _log File "C:\Python36\lib\logging\__init__.py", line 1452, in handle File "C:\Python36\lib\logging\__init__.py", line 1514, in callHandlers File "C:\Python36\lib\logging\__init__.py", line 863, in handle File "C:\Python36\lib\logging\__init__.py", line 1069, in emit File "C:\Python36\lib\logging\__init__.py", line 1059, in _open NameError: name 'open' is not defined

After checking the code found it has been already resolved. So when to expect the new release.

emmettbutler commented 5 years ago

There are enough changes since 2.7.0 for a new minor version release. It needs to be tested for a bit, so I wouldn't expect it for the next month at least. In the meantime you can depend on 2.8.0-dev.3 if you need this change.

sunhailin-Leo commented 5 years ago

This error has been solved yet? I use 2.8.0-dev.5 、2.8.1-dev.1 also have this problem.

sunhailin-Leo commented 5 years ago
--- Logging error ---
Traceback (most recent call last):
  File "C:\Python\Python36\lib\logging\handlers.py", line 73, in emit
    logging.FileHandler.emit(self, record)
  File "C:\Python\Python36\lib\logging\__init__.py", line 1070, in emit
    self.stream = self._open()
  File "C:\Python\Python36\lib\logging\__init__.py", line 1060, in _open
    return open(self.baseFilename, self.mode, encoding=self.encoding)
NameError: name 'open' is not defined
Call stack:
  File "C:\Python\Python36\lib\site-packages\pykafka\handlers.py", line 164, in __del__
    self.stop()
  File "C:\Python\Python36\lib\site-packages\pykafka\handlers.py", line 190, in stop
    log.info("RequestHandler.stop: about to flush requests queue")
Message: 'RequestHandler.stop: about to flush requests queue'
Arguments: ()
emmettbutler commented 5 years ago

@sunhailin-Leo When does this error happen? It looks like something that would happen during interpreter shutdown. Maybe you can provide some code that reproduces the issue?