python: do not ignore the character after a skipped string