Fixed PyStringIO in tests for 2.x