diff --git a/tests/test_protect_call.py b/tests/test_protect_call.py index d10c444..3810e6b 100644 --- a/tests/test_protect_call.py +++ b/tests/test_protect_call.py @@ -96,7 +96,10 @@ class TestProtectCall(common.TrezorTest): self.client.setup_debuglink(button=True, pin_correct=False) def test_backoff(attempts, start): - expected = 0.2 * (2 ** attempts) + if attempts <= 1: + expected = 0.2 + else: + expected = (2 ** (attempts - 2)) got = time.time() - start msg = "Pin delay expected to be at least %s seconds, got %s" % (expected, got) diff --git a/trezorctl b/trezorctl index 29a30c2..ccdabd0 100755 --- a/trezorctl +++ b/trezorctl @@ -209,7 +209,7 @@ class Commands(object): def firmware_update(self, args): if args.file: - fp = open(args.file, 'r') + fp = open(args.file, 'rb').read() elif args.url: print("Downloading from", args.url) r = requests.get(args.url)