From: Oleg Broytman Date: Sat, 2 Sep 2023 12:16:42 +0000 (+0300) Subject: Feat(torrent): Set default encoding to 'ascii' X-Git-Url: https://git.phdru.name/extfs.d.git/?p=extfs.d.git;a=commitdiff_plain;h=305d8404d79009d42d8a421362beb1068bafd9bf Feat(torrent): Set default encoding to 'ascii' Some torrent metafiles do not declare encoding/charset. --- 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):