import six


def right_strip00(the_string):
    """Remove '\x00' bytes from the right end of a byte-string."""
    assert isinstance(the_string, six.binary_type)
    return the_string.rstrip(bytes(b'\x00'))