Encoding adjustments

In python2 some context don't like the URL from the method line
being unicode, so we skip the decoding of that.

If we can't write data for the results, turn it into bytes.