Fix return value from guess_mimetype on Python 3.
Review Request #11186 — Created Sept. 19, 2020 and submitted
Mimetype guessing was returning the mimetype as
unicode), due to the default behavior of
Python 2 this is fine because bytes and unicode are pretty freely
intercompatible, but on Python 3 this would then explode later on when
attempting to serialize a file attachment object with that mimetype set,
While I was here I fixed the order of arguments in a log message to make
I had been experiencing problems when using certain Review Bot tools
with the Review Board server running on Python 3.8. When the tool
attempted to create the
tool-outputattachment, it would get an error
serializing "bytes" and spit out a warning about being unable to parse
the mimetype. After this change, everything works as expected.