def _showtraceback(self, etype, evalue, stb: str):
    'Actually show a traceback.\n\n        Subclasses may override this method to put the traceback on a different\n        place, like a side channel.\n        '
    val = self.InteractiveTB.stb2text(stb)
    try:
        print(val)
    except UnicodeEncodeError:
        print(val.encode('utf-8', 'backslashreplace').decode())
Actually show a traceback.

Subclasses may override this method to put the traceback on a different
place, like a side channel.
def _showtraceback(self, etype, evalue, stb: str):
    'Actually show a traceback.\n\n        Subclasses may override this method to put the traceback on a different\n        place, like a side channel.\n        '
    val = self.InteractiveTB.stb2text(stb)
    try:
        print(val)
    except UnicodeEncodeError:
        print(val.encode('utf-8', 'backslashreplace').decode())