Python3: Use six.StringIO for io.Bytes()

The newer version of six (1.4.1) provides six.StringIO which
is a fake file object for textual data. It's an alias for StringIO.StringIO
in python2 and io.StringIO in Python3.

Use the fake object where approiate.

Change-Id: I364001933b4f2305ac27b293a9a4a3fec36c8a49
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Python3: Fix traceback while running unit tests

While running the unit tests with python3 the following
traceback appears:

TypeError: can't use a string pattern on a bytes-like object

This is due to the way that python2 and python3 handles unicodes.

Change-Id: I401f1cefed69780073222cae98d8da4c3d8031a8
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Merge "Python3: Fix traceback while running unit tests"
Merge "Python3: Use six.StringIO for io.Bytes()"