Skip to content

Commit

Permalink
Incorrect usage of sys.getsizeof to calculate the byte size of even…
Browse files Browse the repository at this point in the history
…t data

Fixes pusher#236
  • Loading branch information
guptag911 committed Jan 20, 2025
1 parent 239d67b commit 4f54cc4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pusher/pusher_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def trigger_batch(self, batch=[], already_encoded=False):

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

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

if is_encrypted_channel(event['channel']):
Expand Down

0 comments on commit 4f54cc4

Please sign in to comment.