1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# bpython version 0.18 on top of Python 3.7.6

>>> import uuid
>>> u = uuid.uuid1()
>>> b = codecs.encode(u.bytes, "base64")
>>> type(b)
<class 'bytes'>
>>> b.rstrip("=\n")
Traceback (most recent call last):
  File "<input>", line 1, in <module>
    b.rstrip("=\n")
TypeError: a bytes-like object is required, not 'str'