Fixed topic attachments under Python 3.

file() doesn't exist under py3, and sha1() requires bytes, not str.
Fixed topic attachments under Python 3.

Forgot a call to file() in previous commit.