Python 2 / 3 compatibility changes (#263)

* Using six.ensure_binary() in write command

* Updated response.content to be coerced to a string for stream.write.

* Adding exception block to catch streams that require string

Most instances require binary text but a few require unicode string in
python 3.x.

* Ensuring string format before json.loads()

Between Python 3.0 and 3.5, json.load and json.loads only accepted
unicode string format. Change was made in 3.6 to automatically adapt to
both unicode and bytes formats.

https://docs.python.org/3/whatsnew/3.6.html#json

* Cherrypicking ed's Changes - MultipartBytesGenerator

Fix to issue on Python 3 where certain sequences of bytes would be
incorrectly mutated (the generator would consider it a line ending that
needed to be changed to what it considered the "correct" characters).

* Linting fixes, updated dependency six version

- Changed docstring to have appropriate spacing
- Changed docstring to be less then 80 chars long
- Updated six in setup.py to be >= v1.12
4 files changed