Guillaume Lebourgeois added the comment:

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

The original bug happened using requests library, so I have no leverage on the 
used method for decoding.

But if you used the "replace" mode with your methodology, you would have raised 
the same Exception : 

>>> content = b'+1911\' rel=\'stylesheet\' type=\'text/css\' />\n<link 
>>> rel="alternate" type="application/rss+xml'
>>> content.decode("utf-7", "replace")
File "<stdin>", line 1, in <module>
  File "/lib/python3.3/encodings/utf_7.py", line 12, in decode
    return codecs.utf_7_decode(input, errors, True)
SystemError: invalid maximum character passed to PyUnicode_New

----------

_______________________________________
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