More Python 3.2 fixes - attachment encoding