'Convert the headers into a list suitable for WSGI.
The values are byte strings in Python 2 converted to latin1 and unicode
strings in Python 3 for the WSGI server to encode.
:return: list'

def to_wsgi_list(self):

    if PY2:
        return [(to_native(k), v.encode('latin1')) for (k, v) in self]
    return list(self)
