You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apparently both brotli and brotlipy use the same name, except the former installs brotli.py module and the latter brotli/ package. Therefore, the latter takes precedence if installed, and breaks logbook:
__________________________________________ test_compression_file_handler[ContextEnteringStrategy-False] ___________________________________________
logfile = '/tmp/pytest-of-mgorny/pytest-5/test_compression_file_handler_1/logfile.log'
activation_strategy = <class 'tests.conftest.ContextEnteringStrategy'>, logger = <logbook.base.Logger object at 0x7f13c9433198>, use_gzip = False
@pytest.mark.parametrize("use_gzip", [True, False])
def test_compression_file_handler(logfile, activation_strategy, logger, use_gzip):
handler = logbook.GZIPCompressionHandler(logfile) if use_gzip else logbook.BrotliCompressionHandler(logfile)
handler.format_string = '{record.level_name}:{record.channel}:{record.message}'
with activation_strategy(handler):
logger.warn('warning message')
handler.close()
> assert _decompress(logfile, use_gzip) == 'WARNING:testlogger:warning message\n'
E AssertionError: assert '' == 'WARNING:test...ing message\n'
E - WARNING:testlogger:warning message
tests/test_file_handler.py:242: AssertionError
-------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/logbook/logbook/handlers.py", line 216, in handle
self.emit(record)
File "/tmp/logbook/logbook/handlers.py", line 586, in emit
self.write(self.encode(msg))
File "/tmp/logbook/logbook/handlers.py", line 699, in write
ret = self._compressor.process(item)
AttributeError: 'Compressor' object has no attribute 'process'
Logged from file /tmp/logbook/tests/test_file_handler.py, line 240
______________________________________________ test_compression_file_handler[PushingStrategy-False] _______________________________________________
logfile = '/tmp/pytest-of-mgorny/pytest-5/test_compression_file_handler_3/logfile.log'
activation_strategy = <class 'tests.conftest.PushingStrategy'>, logger = <logbook.base.Logger object at 0x7f13c940b5f8>, use_gzip = False
@pytest.mark.parametrize("use_gzip", [True, False])
def test_compression_file_handler(logfile, activation_strategy, logger, use_gzip):
handler = logbook.GZIPCompressionHandler(logfile) if use_gzip else logbook.BrotliCompressionHandler(logfile)
handler.format_string = '{record.level_name}:{record.channel}:{record.message}'
with activation_strategy(handler):
logger.warn('warning message')
handler.close()
> assert _decompress(logfile, use_gzip) == 'WARNING:testlogger:warning message\n'
E AssertionError: assert '' == 'WARNING:test...ing message\n'
E - WARNING:testlogger:warning message
tests/test_file_handler.py:242: AssertionError
-------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/logbook/logbook/handlers.py", line 216, in handle
self.emit(record)
File "/tmp/logbook/logbook/handlers.py", line 586, in emit
self.write(self.encode(msg))
File "/tmp/logbook/logbook/handlers.py", line 699, in write
ret = self._compressor.process(item)
AttributeError: 'Compressor' object has no attribute 'process'
Logged from file /tmp/logbook/tests/test_file_handler.py, line 240
This is a major problem since brotlipy is required by hyper-h2.
The text was updated successfully, but these errors were encountered:
Apparently both
brotli
andbrotlipy
use the same name, except the former installsbrotli.py
module and the latterbrotli/
package. Therefore, the latter takes precedence if installed, and breaks logbook:This is a major problem since brotlipy is required by hyper-h2.
The text was updated successfully, but these errors were encountered: