py3: use %d instead of %s when formatting an int into a byte string

Authored by Kwan.