Python: fixed bulk_write