Since no answers are forthcoming, I'll write up what I've found online without digging too deep.
In summary, I get the following impression:
- He wanted to leave France to escape the war, primary by going to the USA
- Before managing to travel to the USA he visited Finland with at least the intention of visiting the USSR.
- He did not expect war between Finland and the USSR, at least so soon.
- It's unclear to me whether he visited the USSR or not before being arrested in Finland.
In a comment to my question, Alexandre Eremenko referred to another answer of his, which says he had visited the USSR and had come (back?) to Finland, citing Weil's memoirs.
he left France to visit....Soviet Union:-) After Soviet Union, he visited Finland... just few days before Soviet Union attacked it
All this is from Weil's memoirs "The apprenticeship of a mathematician", Translated from the 1991 French original by Jennifer Gage. Birkhäuser Verlag, Basel, 1992.
According to this MacTutor biography, Weil was in Finland visiting Rolf Nevanlinna and Lars Ahlfors, but this article does not mention him ever being in the USSR. It quotes a letter from Weil himself, but the quote only mentions a letter about a potential visit:
There was also a letter in Russian, from Pontryagin, I believe, in response to a letter I had written at the beginning of the summer regarding a possible visit to Leningrad
The MacTutor article does not cite a source for that particular paragraph. The next paragraph about his imprisonment in France cites: A Borel, André Weil, Bull. Amer. Math. Soc. 46 (4) (2009), 661–666. That paper only says:
In summer 1939, A. Weil and his wife, Eveline, were in Finland when the Second World War broke out. He decided not to return to France to joint the army, though it was his legal obligation, of course. While his wife went back to France, he remained temporarily in Finland, before deciding which course of action to take.
I've found the following citation which seems authorative:
Osmo Pekonen: L'affaire Weil à Helsinki en 1939, Gazette des mathématiciens 52 (avril 1992), pp. 13–20. With an afterword by André Weil.
but unfortunately I cannot read French well enough to follow it up. In any case a footnote in this biographical article says:
An article by O. Pekonen (L’affaire Weil à Helsinki en 1939, Gaz. Math., No. 52 (1992), 13–20) gives further historical background but disputes that Weil was about to be executed. In a postscript at the end of the Pekonen article, Weil points out that Pekonen provides no facts that contradict Weil’s version.