From bcc7a74725abcdbd43b00689c3705bffe7e48480 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Sun, 29 Oct 2017 22:11:05 +0000 Subject: [#3112|Console] Fix handling hex for setting peer_tos in config The token parser was converting hex value to int which is not what should be passed onto libtorrent peer_tos setting. --- deluge/ui/console/commands/config.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/deluge/ui/console/commands/config.py b/deluge/ui/console/commands/config.py index 4248edb4f..5d8a6ef62 100644 --- a/deluge/ui/console/commands/config.py +++ b/deluge/ui/console/commands/config.py @@ -61,7 +61,11 @@ def atom(next, token): if token[1] == "-": return int(token[-1], 0) else: - return int(token[1], 0) + if token[1].startswith('0x'): + # Hex number so return unconverted as string. + return token[1].decode("string-escape") + else: + return int(token[1], 0) except ValueError: try: return float(token[-1]) -- cgit