Skip to content

Commit 365cae0

Browse files
committedOct 14, 2017
Added limit of 100 bytes for Bytes debug prints
·
2.2.151.4.0
1 parent d10051b commit 365cae0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎kafka/protocol/types.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ def decode(cls, data):
9898
raise ValueError('Buffer underrun decoding Bytes')
9999
return value
100100

101+
@classmethod
102+
def repr(cls, value):
103+
return repr(value[:100] + b'...' if len(value) > 100 else b'')
104+
101105

102106
class Boolean(AbstractType):
103107
@classmethod

1 commit comments

Comments
 (1)

brett-mobsby commented on Nov 27, 2017

@brett-mobsby

Should have checked the Pull Requests first.
My issues are covered by:
Fix two bugs in printing bytes instance #1296

Please sign in to comment.