  Chebyshev spectral methods are widely used in numerical computations. When
the underlying function has a singularity, it has been observed by L. N.
Trefethen in 2011 that its Chebyshev interpolants exhibit an error localization
property, that is, their errors in a neighborhood of the singularity are
obviously larger than elsewhere. In this paper, we first present a pointwise
error analysis for Chebyshev projections of functions with a singularity and
prove that the rate of convergence of Chebyshev projections of degree $n$ at
each point away from the singularity is one power of $n$ faster than that of at
the singularity. This gives a rigorous justification for the error localization
of Chebyshev projections. We then extend the framework of our analysis to
Chebyshev interpolants, Chebyshev spectral differentiations and Legendre
projections and justify their error localization using similar arguments. As a
result, we find that Chebyshev spectral differentiations converge faster than
their best counterparts except in a neighborhood of the singularity and, in the
particular case where the singularity is located in the interior of interval,
they converge even faster than their best counterparts in the maximum norm.
