I have to admit I've never faced these problems before, so let me make sure I understand:
If that branch is true, that means content is unicode and I should check via the regex.
In python3.x that will be true for every string (both 'foo' and u'bar'), every string is unicode.
in python2.x that will be false for 'foo' strings and true for 'bar' strings. ASCII and Unicode strings are different.
Is that correct?