use the correct way to convert unicode to string. I also think this warning should be removed since it can happen when unicode_literals from __future__ is enabled.