Matthew Barnett added the comment:

The bytestring literal isn't valid. It starts with b" and later on has an 
unescaped " followed by more characters.

Also, the usual way to decode by using the .decode method.

I get this:

>>> content = b"+1911\' rel=\'stylesheet\' type=\'text/css\' />\n<link 
>>> rel=\"alternate\" type=\"application/rss+xml\""
>>> content.decode("utf-7", "strict")
Traceback (most recent call last):
  File "<pyshell#10>", line 1, in <module>
    content.decode("utf-7", "strict")
  File "C:\Python33\lib\encodings\utf_7.py", line 12, in decode
    return codecs.utf_7_decode(input, errors, True)
UnicodeDecodeError: 'utf7' codec can't decode bytes in position 0-5: partial 
character in shift sequence

----------
nosy: +mrabarnett

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue19279>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to