def remove_trailing_space(s, punctuation="!?.,"):
    """ Removes a trailing space in a sentence eg.
        "I saw a foo ." to "I saw a foo."
    """

    for punc in punctuation:
        if len(s) < 2:
            return s
        if " %s" % punc == s[-2:]:
            s = s[:-2] + punc

    for punc in punctuation:
        if "%s%s" % (punc, punc) == s[-2:]:
            s = s[:-1]

    return s