sorry, I do not familiar with C. 
The old code seems like try to compatible with either unicode and bytes. So if use "ssi", we can accept them both or does this require specific python version?