Issue 29713: String changes whether or not '\x81' is present (original) (raw)
It works fine for me. If I write the data to a file (using print) and look at it with vi, I see your expected string with <81> on the end. It also works fine in my console (which otherwise produces mostly unknown character glyphs; I'm using a utf8 locale) if I use unicode, or python3.
So, the problem is not with python, it must be your terminal emulator or whatever else it is you are using to inspect the results.