def METHOD_NAME(self):
    #  Calling `compat.to_unicode` with an already decoded `bytearray`
    # This represents the double-decode issue, which can cause a `UnicodeEncodeError`
    #   `bytearray('\xc3\xbf').decode('utf-8').decode('utf-8')`
    res = to_unicode(bytearray(b"\xc3\xbf").decode("utf-8"))
    assert type(res) == unicode
    assert res == u"ÿ"