THERE is nowhere quite like Edinburgh in August. Thousands of artists, actors, writers, jugglers and musicians descend on the city for its festivals. The streets are alive with the sound of fun. This year, though, ten writers, mostly from Africa and the Middle East, nearly missed the party—thanks to the heavy-handed bureaucracy of British visas.

Every summer more than 900 writers from 55 countries are invited to the Edinburgh International Book Festival. Their travel and accommodation are paid for and they are offered an honorarium. Yet consular officials have forced authors to make repeated applications for entry visas and to provide ever more personal details to prove that they will not become a burden on the state.

A leading African novelist was asked to supply a letter from two cardiologists stating that he was fit to travel. Another writer had to produce his daughter’s birth certificate, his marriage certificate and three years of bank statements as proof that he would return home. A Middle Eastern university professor was told that £12,000 ($15,000) of savings in his current account was “suspiciously large”; another that she had too little money. On August 14th the Scottish first minister, Nicola Sturgeon, described the mess as “embarrassing”. As Nick Barley, director of the book festival, says, “the message going out to authors abroad is that they are not wanted here.”

The snarl-up seems to reflect a mix of zealotry and paperwork. Few British embassies process visas locally any more. Instead they are handled by private firms, such as TLScontact, and applications are sent to “large-scale decision-making centres” in Istanbul, Manila and Sheffield to be approved. It is almost impossible to ask in person how a visa application is progressing. E-mail inquiries are charged to the applicant’s credit card. Visas are rejected on the flimsiest grounds, and appeals are difficult. The political climate does not help. Staff at all levels of the Foreign Office are being diverted to work on Brexit, and immigration officers at British airports are scrutinising passports and visas more aggressively than usual, claim writers at the book festival.

“Britain seems to be saying that it is not open to cultural dialogue,” Mr Barley says. “If we want to be open for business after Brexit, which we do, we need to have dialogue. You cannot have business without trust. You don’t trust without dialogue. You don’t trade without trust.” Thanks to noisy interventions by diplomats, the British Council and the Scottish government, all but one of the authors was eventually able to travel to Edinburgh to take part in the festival. But it was a close-run thing. Not Britain’s finest hour.