BUG: Fix 'TypeError: expected bytes, str found' on Python 3
Merge pull request #3141 from cgohlke/patch-1

BUG: Fix 'TypeError: expected bytes, str found' on Python 3