Section 119. Any person who appears, by the proclamation of the governor, to have received not less than one fifth of the entire number of votes cast for electors, may, if the election is contested, apply by petition to the supreme judicial court for Suffolk county, for a declaration of his election as an elector. Such petition shall set forth the name of every person whose election is contested and the ground for the contest, shall be filed within seven days after the date of such proclamation and shall not thereafter be amended. Before any proceedings thereon, the petitioner shall recognize to the commonwealth, in such sum and with such sureties as the court shall order, to pay all costs incurred in the prosecution of his petition if he shall not prevail. If the petitioner prevails, the cost shall be paid by the commonwealth. The court shall fix a day for a hearing by the full court, which shall be not less than three nor more than seven days after the date of the filing of the petition, and shall order notice of the hearing to be given, with a statement of the substance of the petition in such manner as it may direct, to the governor and to every person whose election is contested. The court shall also order such notice to be published in at least one newspaper designated by it in each county.