Before a circuit judge the petition and the papers shall be filed with the clerk of the circuit court of the county in which the prisoner is detained. Before the other courts, justices or judges, the papers shall be filed with the clerk of the court on which the justice or judge sits.