ids = cPickle.loads(gem.value)
loads() argument 1 must be string, not unicode
ids = cPickle.loads(gem.value) loads() argument 1 must be string, not unicode
Share
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.
cPickle.loadswants a byte string (which is exactly whatcPickle.dumpsoutputs) and you’re feeding it a unicode string instead. You’ll need to “encode” that Unicode string to get back the byte string thatdumpshad originally given you, but it’s hard to guess what encoding you accidentally imposed on it — maybelatin-1orutf-8(ifasciidon’t worry, either of those two will decode it just great), maybeutf-16…? It’s hard to guess without knowing whatgemis and how you originally set itsvaluefrom the output of acPickle.dumps…!