IT WAS all looking so hopeful. After four years in political limbo since a coup in early 2009, a date had finally been set for Madagascar’s presidential election: July 24th. The UN had endorsed it; the European Union was putting up money; and the Southern African Development Community (SADC) had brokered a deal whereby neither Marc Ravalomanana, who had been ousted in the coup, nor Andry Rajoelina, the coup-maker, would run. But then Lalao Ravalomanana, the wife of the ousted president, queered the pitch by deciding to run in his colours.

Mr Rajoelina retaliated by declaring that he would run after all. SADC and an array of governments were furious. Mrs Ravalomanana was anyway deemed by many to be unqualified to run because she had not resided in Madagascar for the required six months before her bid. Mr Rajoelina had missed a deadline for registering. SADC also cast doubt on the candidacy of Didier Ratsiraka, a former president, whose residential qualification it also queried. Still, the Special Electoral Court approved all three, but SADC promptly called on the wayward trio to withdraw. The EU, the UN and African Union followed suit, threatening not to recognise the results and to withdraw support for the poll.

Mrs Ravalomanana and Messrs Rajoelina and Ratsiraka continued to stand their ground, plunging the country into a crisis. The July 24th poll now seems unlikely. On June 6th, the cabinet unilaterally put off the election until August 23rd; a week later, the Constitutional Court ruled that it was up to the electoral commission, not the executive, to make such decisions. The commission is now pondering its options. South Africa has withdrawn its offer to print Madagascar’s 9m ballot papers, and local Malagasy printers will need several months to be able to do so.

Yet the commission is under a lot of pressure to hold elections as soon as possible. The army may be losing patience, as are many of the 41 presidential candidates, some of whom threaten to overthrow the government if the poll is not put back on track very soon.