[Pkg-auth-maintainers] Bug#965059: Syntax warnings with Python 3.8
Petter Reinholdtsen
pere at hungry.com
Thu Sep 9 07:08:44 BST 2021
[Petter Reinholdtsen]
> I see the same messages, but my run is followed up with this crash.
> Perhaps a releated issue?
I managed to get the tool working again using this patch:
--- /usr/bin/yubikey-totp 2020-03-31 06:00:00.000000000 +0200
+++ /tmp/yubikey-totp 2021-09-09 08:04:05.413315000 +0200
@@ -103,7 +103,7 @@
print("Serial : %i" % YK.serial())
print("")
# Do challenge-response
- secret = struct.pack("> Q", args.time / args.step).ljust(64, chr(0x0))
+ secret = struct.pack("> Q", int(args.time / args.step)).ljust(64, bytes.fromhex('00'))
if args.debug:
print("Sending challenge : %s\n" % (binascii.hexlify(secret)))
response = YK.challenge_response(secret, slot=args.slot)
Seem to me the problem is python3 making divisions return floating point
numbers and bytes.ljust() now only accepting bytes as its second
argument.
--
Happy hacking
Petter Reinholdtsen
More information about the Pkg-auth-maintainers
mailing list