https://github.com/python-intelhex/intelhex/blob/9769d3f6e1beefa3bd0c2b266d60197d61669881/intelhex/compat.py#L60 tostring has to become tobytes for this to work in Python 3.9, likely in versions before this as well.