The governor shall appoint a temporary judge, chancellor or district attorney general in all cases where a contest arises in the election of any of those officers, and they shall hold the offices, and have all the powers and jurisdiction pertaining to the offices, until the contest is judicially determined and the regularly elected officers are duly qualified and commissioned; and they are clothed with the same power, and shall receive the same compensation, as is allowed the officer in other cases, to be paid out of the state treasury upon a warrant of the commissioner of finance and administration.