Convert data in responses and resource streams to the right string type.
Review Request #9735 — Created March 4, 2018 and submitted
HttpResponsereturns data as byte strings, and in Python 2.x we could
generally just check against those without problems, but on Python 3.x
the different string types are less compatible. We now convert the
responses to Unicode strings using Django's
intelligently performs a decode when necessary).
We also convert the result of
DMARC code, for use in
PublicSuffixList. Rather than a straight text
conversion, we need to make use of
codecs.getreader(), which will
correctly convert the data in the stream to the right format.
Unit tests pass on Python 2.7, 3.4, 3.5, and 3.6.
Split a complex statement up into multiple lines.
Revision 2 (+13 -6)
Checks run (2 succeeded)