From 07164c1d0a6ac079763df9a21b6acc6bf5a1a9a8 Mon Sep 17 00:00:00 2001 From: Yonatan Goldschmidt Date: Tue, 25 Jan 2022 20:50:24 +0200 Subject: [PATCH 1/2] Fix crc32c's __main__ for Python 3 --- kafka/record/_crc32c.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kafka/record/_crc32c.py b/kafka/record/_crc32c.py index ecff48f5e..3988a6833 100644 --- a/kafka/record/_crc32c.py +++ b/kafka/record/_crc32c.py @@ -141,5 +141,5 @@ def crc(data): import sys # TODO remove the pylint disable once pylint fixes # https://github.com/PyCQA/pylint/issues/2571 - data = sys.stdin.read() # pylint: disable=assignment-from-no-return + data = sys.stdin.buffer.read() # pylint: disable=assignment-from-no-return print(hex(crc(data))) From 3af6090e31aace10219c44172f28e3f14695c36d Mon Sep 17 00:00:00 2001 From: William Barnhart Date: Thu, 3 Aug 2023 09:20:56 -0400 Subject: [PATCH 2/2] Remove TODO from _crc32c.py --- kafka/record/_crc32c.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/kafka/record/_crc32c.py b/kafka/record/_crc32c.py index 3988a6833..1269d08d4 100644 --- a/kafka/record/_crc32c.py +++ b/kafka/record/_crc32c.py @@ -139,7 +139,5 @@ def crc(data): if __name__ == "__main__": import sys - # TODO remove the pylint disable once pylint fixes - # https://github.com/PyCQA/pylint/issues/2571 data = sys.stdin.buffer.read() # pylint: disable=assignment-from-no-return print(hex(crc(data)))