On Wed, 06 Jul 2016 15:30:26 +0200 Leopold Palomo-Avellaneda <[email protected]> wrote:> On Fri, 27 May 2016 20:33:54 +0000 Mattia Rizzolo <[email protected]> wrote:
>
> The question then is why this line could produce the error is some packages
> and in other no.
>
> Leopold
>
>

Hi,


I just stumbled across this issue when trying to recompile the uswsusp package with pbuilder & pbuilder-satisfydepends-gdebi.

It happens when the package's control file contains non-ASCII characters. In uswsusp's case, the Maintainer field contains "Rodolfo García Peñas (kix) <[email protected]>".

It seems /usr/lib/python3/dist-packages/apt/debfile.py does not account for this and I'm not sure how this could be fixed (does the Debian policy even state what the character encoding should be for the control file?)


To see which field triggers the error, I patched the open method inside the DscSrcPackage class and replaced line 745:

                        self._sections[tag] = sec[tag]

with:

                        try:

                            self._sections[tag] = sec[tag]

                        except UnicodeDecodeError as e:

                            raise ValueError(tag)


I also replaced the call to logger.debug in the code fragment quoted by Mattia Rizzolo with a call to logger.error (so that the error actually gets display on the console when running pbuilder)

Now, I get this kind of output:

I: Installing the build-deps
ERROR:root:error opening: Maintainer
Failed to open the software package
The package might be corrupted or you are not allowed to open the file. Check 
the permissions of the file.

Which put me on the right track. And sure enough, if I remove the diacritics from kix's fullname, I can now rebuild the package just fine.


Regards,
François

Reply via email to