You have assigned a bytes value to the name bytes: >>> bytes([10, 20, 30, 40]) b'\n\x14\x1e(' >>> bytes = bytes([10, 20, 30, 40]) >>> bytes([10, 20, 30, 40]) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: 'bytes' object is not callable bytes is now bound to the value b'\n\x14\x1e(', which is not callable. This global is shadowing the built-in. Delete it:
del bytes -- https://mail.python.org/mailman/listinfo/python-list