I\'m using the Pyparsing library to evaluate simple boolean queries like these ones:
Answer by @PaulMcGuire:
Change boolExpr.parseString(t)[0] to boolExpr.parseString(t, parseAll=True)[0]. Pyparsing will not raise an exception if it can find a valid match in the leading part of the string, even if there is junk tacked on to the end. By adding parseAll=True, you tell pyparsing that the entire string must parse successfully.