python simhash doesn't work on ubuntu -


I have the code to run the same setup and simshash on Mac, it works.

But when I

objs = [(str (k), simash (v))

in index_data.items () v, "file / / url /local/lib/python2.7/dist-packages/simhash-1.1.2-py2.7.egg/simhash/ < Strong> init .i ", line 30, in init self.build_by_text (Unicode (value)) Unicodecode error: 'ascii' codec can not decode byte 0xf6 in position 34: In the serial no category (128)

The error tells you that str (k) is correctly Can not be decoded. Since I do not know where the data is coming from and what it really is, I can only say that

  str (k) .decode ('cp850')   

or

  Simhash (v.decode ('cp850')) Maybe   

Let's assume that string cp At 850, at least I can do a '\ xf6'.decode (' cp850 ') .

And since it seems that there is a problem with the module, check that the string is used properly is already decoded properly.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -