I don’t understand
in 2.X it worked :
import zlib
zlib.compress('Hello, world')
now i have a :
zlib.compress("Hello world!")
TypeError: must be bytes or buffer, not str
How can i compress my string ?
Regards
Bussiere
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is meant to enforce that you actually have a defined encoding.
The same string could describe different byte sequences otherwise. But it is actually a byte sequence that will be encoded by zlib.