handle an exception from difflib