def _chomp(string):
    """Rather than rstrip(), remove only the last newline and preserve purposeful whitespace"""
    if len(string) and string[-1] == '\n':
        string = string[:-1]
    if len(string) and string[-1] == '\r':
        string = string[:-1]
    return string