  Let $X$ be a nilpotent space such that there exists $N\geq 1$ with
$H^N(X,\mathbb Q) \ne 0$ and $H^n(X,\mathbb Q)=0$ if $n>N$. Let $Y$ be a
m-connected space with $m\geq N+1$ and $H^*(Y,\mathbb Q)$ is finitely generated
as algebra. We assume that the odd part of the rational Hurewicz homomorphism:
$\pi_{odd}(X)\otimes \mathbb Q\to H_{odd}(X,\mathbb Q)$ is non-zero. We prove
that if the space $\mathcal F(X,Y)$ of continuous maps from $X$ to $Y$ is
rationally formal, then $Y$ has the rational homotopy type of a finite product
of Eilenberg Mac Lane spaces. At the opposite, we exhibit an example of a
rationally formal space $\mathcal F(S^2,Y)$ where $Y$ is not rationally
equivalent to a product of Eilenberg Mac Lane spaces.
