Started porting UDD to Python3 (Was: [UDD] Is there some effort to port UDD to Python3?)
- To: Lucas Nussbaum <lucas@lucas-nussbaum.net>
- Cc: Debian QA List <debian-qa@lists.debian.org>, Bas Couwenberg <sebastic@debian.org>, Gianfranco Costamagna <locutusofborg@debian.org>, Ivo De Decker <ivo.dedecker@ugent.be>, kroeckx <kroeckx@debian.org>, laney <laney@debian.org>, Mattia Rizzolo <mattia@debian.org>, Ole Streicher <ole@aip.de>, Paul Wise <pabs@debian.org>, zack <zack@debian.org>
- Subject: Started porting UDD to Python3 (Was: [UDD] Is there some effort to port UDD to Python3?)
- From: Andreas Tille <andreas@an3as.eu>
- Date: Thu, 14 May 2020 11:43:32 +0200
- Message-id: <[🔎] 20200514094332.GU550@an3as.eu>
- In-reply-to: <[🔎] 20200513174056.GM550@an3as.eu>
- References: <20200401132433.GN20899@an3as.eu> <20200413204007.GB19310@xanadu.blop.info> <20200414064711.GG18187@an3as.eu> <[🔎] 20200513143842.GK550@an3as.eu> <[🔎] 20200513150902.GA1301@xanadu.blop.info> <[🔎] 20200513174056.GM550@an3as.eu>
On Wed, May 13, 2020 at 07:40:56PM +0200, Andreas Tille wrote:
> >
> > Use the Vagrant development environment?
>
> I admit I've never worked with this. You said its pretty simple and I
> would guess a python3 branch where everybody commits the code he feels
> responsible for and test it would be sufficient. But I'm fine to adapt
> (if you point me to some doc).
I've just followed my proposal to create a python3 branch, fired up 2to3
and fixed some issues manually. My gatherers blends-prospective, ftpnew
and screenshots should work. I'm now stumbling upon:
udd(python3) $ ./only-run.sh ddtp
Traceback (most recent call last):
File "/srv/udd.debian.org/udd//udd.py", line 88, in <module>
exec("gatherer.%s()" % command)
File "<string>", line 1, in <module>
File "/srv/udd.debian.org/udd/udd/ddtp_gatherer.py", line 125, in run
h.update(f.read())
File "/usr/lib/python3.8/codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc5 in position 11: invalid continuation byte
I tried to fix this using this patch:
$ git diff
diff --git a/udd/ddtp_gatherer.py b/udd/ddtp_gatherer.py
index 46e588d..7cc625c 100644
--- a/udd/ddtp_gatherer.py
+++ b/udd/ddtp_gatherer.py
@@ -117,7 +117,7 @@ class ddtp_gatherer(gatherer):
trfile = trfilepath + file
# check whether hash recorded in index file fits real file
try:
- f = open(trfile)
+ f = open(trfile, encoding='utf-8')
except IOError as err:
self.log.error("%s: %s.", str(err), trfile)
continue
but it does not help. Any hint would be welcome.
Kind regards
Andreas.
--
http://fam-tille.de
Reply to: