def _convert_to_bytes(path):
    """Convert path to raw bytes"""
    path_bytes = path.encode()
    if not isinstance(path_bytes, bytes):
        raise ValueError("Cannot convert to bytes: " + path)
    return path_bytes