sf2github
sf2github copied to clipboard
UnicodeDecodeError when trying to add binary attachment to issue
Trying to import the attachment in https://sourceforge.net/p/openflights/bugs/174/ crashes with a UnicodeDecodeError:
Adding comments...
Adding attached file: http://sourceforge.net/p/openflights/bugs/_discuss/thread/deb8749f/c8fc/attachment/OFloopbug.mov
Traceback (most recent call last):
File "./sf2ghJSON.py", line 112, in <module>
issue.updateAllIssues(auth, args.repo, export, not args.no_id_in_title, collaborators, prefix)
File "/Users/jani/projects/openflights-code/sf2github/issue.py", line 118, in updateAllIssues
sfTicket['discussion_thread']['posts'])
File "/Users/jani/projects/openflights-code/sf2github/issue.py", line 143, in addAllComments
post += ' ' + line
UnicodeDecodeError: 'ascii' codec can't decode byte 0x83 in position 47: ordinal not in range(128)
Looking at the line in question, is it really dumping the contents of the attachment as text into the issue? This is not going to work great when the attachment is binary, like the .mov in this case.
Eh, I commented as much on https://github.com/ttencate/sf2github/pull/32, but I'm very lenient in accepting PRs on this project. That was totally a hint ;)
Sorry, my python skills are not yet very good. Thanks @jpatokal for fixing this.