◐ Shell
clean mode source ↗

Message 77264 - Python tracker

doctest.testmod() fails when attempting to echo back a bytes type with
ord() > 128.


def ok():
   """
>>> bytes([255,])
b'\xff'

"""
    pass

def notOK():
    """
>>> b'\xff'

"""
    pass

import doctest
doctest.testmod()

Traceback (most recent call last):
...
UnicodeEncodeError: 'ascii' codec can't encode character '\xff' in
position 141: ordinal not in range(128)