I've often heard it said that the motion of a double pendulum is non-periodic. (This may be related to the fact that it's a chaotic system, but I'm not sure about that.) But this does not seem possible to me, for the following reason. Let $\theta_1$ and $\theta_2$ be the angles of the two masses relative to the vertical. Then we can consider the two-dimensional phase space with a $\theta_1$ axis and a $\theta_2$ axis, and the motion of the double pendulum is a continuous curve $\gamma:[0,\infty) \rightarrow [0,2\pi]\times[0,2\pi]$. The thing is, I'm pretty sure such a curve must be self-intersecting. Because if it's not self-intersecting, then its graph would cover more and more of the codomain with time, and so I think you'd get a space-filling curve. And yet space-filling curves are always self-intersecting, so you'd get a contradiction. Thus $\gamma$ must be self-intersecting, and thus the motion of a double pendulum is always periodic.
So what's wrong with my reasoning? Or is my reasoning correct, and is the motion of a double pendulum always periodic, just with such a long period that it looks non-periodic? If so, is there a formula for the period?