gnu: tremc: Fix execution with recent Python.

* gnu/packages/bittorrent.scm (tremc)[source]: Add patch.
* gnu/packages/patches/tremc-fix-decodestring.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.

Reported by gnoo in #guix
This commit is contained in:
Tobias Geerinckx-Rice 2022-01-06 19:32:43 +01:00
parent b1cf1d44f4
commit b4263f12ed
No known key found for this signature in database
GPG Key ID: 0DB0FF884F556D79
3 changed files with 28 additions and 1 deletions

View File

@ -1857,6 +1857,7 @@ dist_patch_DATA = \
%D%/packages/patches/tor-sandbox-i686.patch \
%D%/packages/patches/transcode-ffmpeg.patch \
%D%/packages/patches/transmission-honor-localedir.patch \
%D%/packages/patches/tremc-fix-decodestring.patch \
%D%/packages/patches/trytond-add-egg-modules-to-path.patch \
%D%/packages/patches/trytond-add-guix_trytond_path.patch \
%D%/packages/patches/ttf2eot-cstddef.patch \

View File

@ -231,7 +231,8 @@ XML-RPC over SCGI.")
(file-name (git-file-name name version))
(sha256
(base32
"1fqspp2ckafplahgba54xmx0sjidx1pdzyjaqjhz0ivh98dkx2n5"))))
"1fqspp2ckafplahgba54xmx0sjidx1pdzyjaqjhz0ivh98dkx2n5"))
(patches (search-patches "tremc-fix-decodestring.patch"))))
(build-system gnu-build-system)
(arguments
`(#:tests? #f ; no test suite

View File

@ -0,0 +1,25 @@
From 79995bc82e81f0429222aab4d90a03440feef057 Mon Sep 17 00:00:00 2001
From: Matan Ziv-Av <matan@svgalib.org>
Date: Mon, 29 Jun 2020 15:18:03 +0300
Subject: [PATCH] Use base64.decodebytes.
Based on upstream commit 79995bc82e81f0429222aab4d90a03440feef057 which
confuses several unrelated changes.
---
tremc | 29 ++++++++++++++++++++++++++++-
1 file changed, 28 insertions(+), 1 deletion(-)
diff --git a/tremc b/tremc
index b47f012..c626fde 100755
--- a/tremc
+++ b/tremc
@@ -440,7 +443,7 @@ class Transmission(object):
# TAG_TORRENT_DETAILS, but just passing seems to help.(?)
try:
torrent_details = response['arguments']['torrents'][0]
- torrent_details['pieces'] = base64.decodestring(bytes(torrent_details['pieces'], ENCODING))
+ torrent_details['pieces'] = base64.decodebytes(bytes(torrent_details['pieces'], ENCODING))
self.torrent_details_cache = torrent_details
self.upgrade_peerlist()
except IndexError: