(This is a fairly basic question, not really research level, except that I am a research mathematician working on other things who is trying to understand more topology for use in my own work.)
Let $\Sigma$ be a smooth, connected, compact 2d manifold, henceforth simple a "surface". We don't assume anything more (not necessarily closed or oriented).
$\Sigma$ has a tangent bundle $T\Sigma$, to which we can associate the "unit sphere bundle" $\mathbf{S}=\mathbf{S}(T\Sigma)$.
There is a map $\Sigma \rightarrow BS^{1}$ classifying this circle bundle, and so a class $c_{1}(\mathbf{S}) \in H^{2}(\Sigma,\mathbf{Z})$, which is the obstruction to trivialising/finding a section of $\mathbf{S}$.
However, if $\Sigma$ is not closed, or not orientable, then $H^{2}(\Sigma,\mathbf{Z})=0$, so the circle bundle $\mathbf{S}$ should admit a section, and hence there should be a nowhere vanishing section of $T\Sigma$, that is a nowhere vanishing vector field on $\Sigma$.
But doesn't that contradict the Poincar'e-Hopf index theorem, saying that the Euler characteristic should be the sum of the indices of zeroes of the vector field? For example, $\mathbf{RP}^{2}$ has Euler characteristic $1$, but the above argument seems to show that there is a nowhere vanishing vector field on $\mathbf{RP}^{2}$ (which I don't believe).
So what gives?