IIRC, I added the ```getattr``` bits to avoid attempting to do ```os.remove(output)``` when ```output``` happens to be a ```io.StringIO``` or ```io.BytesIO```... With your patch, do you get any errors if you try to give one of the ```io.*IO``` classes to ```_encrypt()```?