Replace basestring by six for python3 compatability

The builtin basestring abstract type was removed in python3,
use str instead, we need to using six.string_types to replace
the basestring for python3 compatibility.

Partial Implements bp basestring-py3-compatible

Change-Id: I719e104ae46ebb6e986c53a019b93e3a45e6d0fd
Merge "Replace basestring by six for python3 compatability"