From 305d8404d79009d42d8a421362beb1068bafd9bf Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sat, 2 Sep 2023 15:16:42 +0300 Subject: [PATCH] Feat(torrent): Set default encoding to 'ascii' Some torrent metafiles do not declare encoding/charset. --- torrent | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/torrent b/torrent index ba725c9..bd5ff13 100755 --- a/torrent +++ b/torrent @@ -317,11 +317,11 @@ def decode_torrent(): encoding = encoding.decode('ascii') elif codepage: encoding = codepage.decode('ascii') - - if PY3 and encoding: + else: + encoding = 'ascii' return decode_dict(torrent, encoding) - else: - return torrent + + return torrent def decode_datetime_asc(dt): -- 2.39.2