Cotangent sums and Dirichlet L functions