Re: Started porting UDD to Python3 (Was: [UDD] Is there some effort to port UDD to Python3?)
- To: Andreas Tille <andreas@an3as.eu>
- Cc: Stéphane Blondon <stephane.blondon@gmail.com>, Mattia Rizzolo <mattia@debian.org>, 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>, Ole Streicher <ole@aip.de>, Paul Wise <pabs@debian.org>, zack <zack@debian.org>
- Subject: Re: Started porting UDD to Python3 (Was: [UDD] Is there some effort to port UDD to Python3?)
- From: Lucas Nussbaum <lucas@debian.org>
- Date: Mon, 18 May 2020 22:06:09 +0200
- Message-id: <[🔎] 20200518200609.GA13933@xanadu.blop.info>
- In-reply-to: <[🔎] 20200518195733.GQ12054@an3as.eu>
- References: <[🔎] 20200513174056.GM550@an3as.eu> <[🔎] 20200514094332.GU550@an3as.eu> <[🔎] 6d71c868-5420-ad97-cbbc-b92dc800a244@gmail.com> <[🔎] CAHKYmesvv5U3cU5xJB1Puv07AEmTezK4RmgG7y2qO=1ML-7z-g@mail.gmail.com> <[🔎] bd0a3c2f-ac4f-1f3f-4f37-bd23e95c3d5f@gmail.com> <[🔎] 20200515191033.GN550@an3as.eu> <[🔎] caf4ae40-b8de-afbf-7527-38a91a19a86b@gmail.com> <[🔎] 20200518125958.GN12054@an3as.eu> <[🔎] 789ac21a-0f9f-6e88-3d07-581cbd40716a@gmail.com> <[🔎] 20200518195733.GQ12054@an3as.eu>
Hi,
Do all those people in Cc need to read this? If you really want to keep
this public, maybe debian-qa@ is enough? (I personally don't feel I
need to read this at this time; if I had time to spend on UDD, I would
fix actual bugs)
Thanks
Lucas
On 18/05/20 at 21:57 +0200, Andreas Tille wrote:
> On Mon, May 18, 2020 at 08:35:33PM +0200, Stéphane Blondon wrote:
> >
> > Can you send me the file 'gatherer.${I_dont_know_the_command}' which
> > raises the UnicodeDecodeError exception? I will try to write a working
> > patch.
>
> I simply added a debug line:
>
> udd(python3) $ git diff
> diff --git a/udd/ddtp_gatherer.py b/udd/ddtp_gatherer.py
> index bbf041b..d32b85f 100644
> --- a/udd/ddtp_gatherer.py
> +++ b/udd/ddtp_gatherer.py
> @@ -239,6 +239,7 @@ class ddtp_gatherer(gatherer):
> self.log.exception("Error reading %s%s", dir, filename)
>
> def _open_file(path):
> + print(path)
> with open(path, 'rb') as f:
> raw_content = f.read()
> encoding = chardet.detect(raw_content)["encoding"]
>
>
> which leads to
>
>
> udd(python3) $ ./update-and-run.sh ddtp
> /srv/mirrors/debian/dists/squeeze-proposed-updates/main/i18n/Translation-en.bz2
> /srv/mirrors/debian/dists/squeeze-proposed-updates/non-free/i18n/Translation-en.bz2
> /srv/mirrors/debian/dists/squeeze-proposed-updates/contrib/i18n/Translation-en.bz2
> /srv/mirrors/debian/dists/stretch-proposed-updates/main/i18n/Translation-en.bz2
> 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 127, 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
>
>
> While you can download the files from any Debian mirror I've attached
> /srv/mirrors/debian/dists/stretch-proposed-updates/main/i18n/Translation-en.bz2
> to this mail. My guess is that translations from stretch will not be
> touched any more and thus we need to cope somehow with the existing
> encoding.
>
> Thanks a lot for your help
>
> Andreas.
>
> --
> http://fam-tille.de
Reply to: