This question already has an answer here:
This is something I realized in some text I read (books and articles), I don't identify it when speaking to people. When a pronoun is used replacing an undefined person sometimes "he" is used (I would say most of the time) and others "she" is used. Like in the sentence "The user is very clever, she found an error.", in formal Portuguese writing the pronouns for undefined person are always masculin, is it optional for English?