Testy remarks from a president who has frequently singled out female journalists for criticism and personal attacks.