Reproducer (works on staging):
b=lp.bugs[89040] b.addAttachment(comment='', data=open('thread.txt').read(), description='test353805', filename='test353805', is_patch=False)
This apparently happens because something in launchpadlib assumes that data is UTF-8 encoded. While stack traces are by and large text, they can have binary stuff in it, such as this one.
Reproducer (works on staging):
b=lp.bugs[89040] (comment= '', data=open( 'thread. txt').read( ), description= 'test353805' , filename= 'test353805' , is_patch=False)
b.addAttachment
This apparently happens because something in launchpadlib assumes that data is UTF-8 encoded. While stack traces are by and large text, they can have binary stuff in it, such as this one.