You need to change
line.translate(None, string.punctuation)
to
line = line.translate(None, string.punctuation)
In Python, strings are immutable. Correspondingly, translate()
doesn't change the string in place, but rather returns the translated string (which you're ignoring).