classic worker: make the partitions work under python3

In python 3, hash is salted and will return a different value everytime it is
invoked, therefore, it cannot be used.