Currently, it appends a '0' (zero) character/byte instead of '\0' (null) byte. In some situation, it could raises an error.
I also did a refactor to support python3, but keep it backward compatible with python2.
Tested on Python 2.7.18 and Python 3.10.6.
Merge request:
#759