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
I'm trying to push an 8KB message to pusher and while it works for ascii characters it breaks if for example there is even a single "🦄" char in the dictionary because now sys.getsizeof returns size of the string object as 34KB.
Considering that the final dictionary is encoded to UTF-8 before sending to pusher I think that the length check should also be performed on the UTF-8 encoded string and not on the python object.
The issue is with this code:
if sys.getsizeof(data) > 30720:
raise ValueError("Too much data")
Small demo how much more bytes is consumed for python object compared to UTF-8 string.
The text was updated successfully, but these errors were encountered:
utf-8 characters passed to our library remains as-is (before we accidentally escaped unicode characters so the size ballooned, but this shouldn't be the case anymore)
I'm trying to push an 8KB message to pusher and while it works for ascii characters it breaks if for example there is even a single "🦄" char in the dictionary because now
sys.getsizeof
returns size of the string object as 34KB.Considering that the final dictionary is encoded to UTF-8 before sending to pusher I think that the length check should also be performed on the UTF-8 encoded string and not on the python object.
The issue is with this code:
Small demo how much more bytes is consumed for python object compared to UTF-8 string.
![image](https://user-images.githubusercontent.com/82369111/228205178-85932302-6ddc-41d2-898b-aa5b1bf4d0a2.png)
The text was updated successfully, but these errors were encountered: