fix serialization on Python 3 (use a char array)