From the documentation of the string.whitespace
:
A string containing all ASCII characters that are considered whitespace. This includes the characters space, tab, linefeed, return, formfeed, and vertical tab.
It's the same under python3, where all non-ASCII constants where removed. (In python2 some constants could be influenced by locale
settings).
Hence the difference in behaviour is quite obvious since strip()
does remove any unicode whitespace, while strip(string.whitespace)
removes only ASCII spaces. Your string clearly contains non-ASCII spaces.