Skip to content

Commit 4f54cc4

Browse files
committed
Incorrect usage of sys.getsizeof to calculate the byte size of event data
Fixes pusher#236
1 parent 239d67b commit 4f54cc4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pusher/pusher_client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def trigger_batch(self, batch=[], already_encoded=False):
130130

131131
event['data'] = data_to_string(event['data'], self._json_encoder)
132132

133-
if sys.getsizeof(event['data']) > 10240:
133+
if len(event['data'].encode('utf-8')) > 10240:
134134
raise ValueError("Too much data")
135135

136136
if is_encrypted_channel(event['channel']):

0 commit comments

Comments
 (0)