From: Joshua May Date: Sat, 14 Sep 2019 01:37:17 +0000 (-0700) Subject: bytes don't encode as hex with Python 3, with just .hex() 'em X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=1d45b993357f9b2dbeb4a3d14c06789bf22e67ef;p=sirius.git bytes don't encode as hex with Python 3, with just .hex() 'em --- diff --git a/sirius/fake/commands.py b/sirius/fake/commands.py index 50749b2..908b470 100644 --- a/sirius/fake/commands.py +++ b/sirius/fake/commands.py @@ -22,9 +22,9 @@ fake_manager = script.Manager(sub_opts, usage="Fake printer interactions.") @fake_manager.command def printer(): - device_address = os.urandom(8).encode('hex') + device_address = os.urandom(8).hex() xor = bitshuffle.hardware_xor_from_device_address(device_address) - secret = os.urandom(5).encode('hex') + secret = os.urandom(5).hex() cc = claiming.encode(xor, int(secret, 16)) printer = hardware.Printer(