Package: python-gnupg
Version: 0.3.5-2
Severity: minor

Dear Maintainer,

There are some DD's that have mangled character encodings on their UID
records of their public keys, particularly an 'é' as in José or Lainé,
instead of being encoded as UTF-8 sequence 0xC3 0xA9, they've been
encoded as 0xE9 (like ISO-8859-1).

python-gnupg fails when listing these keys with the following traceback:

  File "/usr/lib/python2.7/dist-packages/gnupg.py", line 1047, in list_keys
    self.decode_errors).splitlines()
  File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xe9 in position 207127: 
invalid continuation byte

This can temporarily be worked around by importing the keyring, editing
the keys and deleting the offending UID packets… until the keys are
refreshed.

I'm a Python newbie so wouldn't know if it's possible to have the
language be more lenient about decoding corrupt UTF-8 data, but after
poking around stackoverflow.com it doesn't seem likely.

Seeing that the module does support locales, I futilely tried exporting
LANG=en_US.ISO-8859-1 which results in "UnicodeDecodeError: 'ascii'
codec can't decode byte 0xc3" errors.

Specific keys:

$ gpg --list-keys 4BE0582590788E11 E2624966A269D927
Keyring: /usr/share/keyrings/debian-keyring.gpg
-----------------------------------------------
pub   1024D/0x4BE0582590788E11 2001-02-01
      Key fingerprint = B06B 023F EAA6 37DC 1E62  B079 4BE0 5825 9078 8E11
uid                 [ unknown] Jose Carlos Garcia Sogo <js...@debian.org>
uid                 [ unknown] Jose Carlos Garcia Sogo <j...@jaimedelamo.eu.org>
uid                 [ unknown] Jose Carlos Garcia Sogo <js...@arrakis.es>
uid                 [ unknown] Jos\xe9\x20Carlos Garc\xed\x61 Sogo
uid                 [ unknown] José Carlos García Sogo <j...@tribulaciones.org>
sub   2048g/0x002DE195AC9EAC51 2001-02-01

Keyring: /usr/share/keyrings/debian-keyring.gpg
-----------------------------------------------
pub   1024D/0xE2624966A269D927 2002-05-04
      Key fingerprint = 190E 48D7 5117 4F42 ABAC  4DD7 E262 4966 A269 D927
uid                 [ unknown] Jeremy Laine <jeremy.la...@polytechnique.org>
uid                 [ unknown] Jeremy Laine <jeremy.la...@m4x.org>
uid                 [ unknown] Jeremy Laine <jeremy_la...@users.sourceforge.net>
uid                 [ unknown] Jeremy Laine <sha...@debian.org>
uid                 [ unknown] Jeremy Lain\xe9\x20<jeremy.la...@m4x.org>
uid                 [ unknown] Jeremy Lainé <jeremy.la...@m4x.org>
sub   1024g/0xD33A84027D816A68 2002-05-04

-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 3.12-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages python-gnupg depends on:
ii  gnupg   1.4.16-1
ii  python  2.7.5-5

python-gnupg recommends no packages.

python-gnupg suggests no packages.

-- no debconf information

-- 
Gerald Turner                                Encrypted mail preferred!
0xEC942276FDB8716D  CA89 B27A 30FA 66C5 1B80  3858 EC94 2276 FDB8 716D

Attachment: pgp0ochYoUmTn.pgp
Description: PGP signature

Reply via email to