Ticket #2529 (closed defect: invalid)

Opened 4 years ago

Last modified 4 years ago

charset problem with gpg key

Reported by: Elghinn Owned by: asterix
Priority: normal Milestone: 0.11
Component: None Version: hg
Severity: normal Keywords:
Cc: Blocked By:
OS: Blocking:

Description

key's name with ë appears Ã\x83«

Attachments

patch2 (0.5 KB) - added by nk 4 years ago.
any luck with this one applied?

Change History

Changed 4 years ago by nk

any luck with this one applied?

Changed 4 years ago by nk

[Yesterday 08:31:04 PM] asterix: my term is utf-8
[Yesterday 08:31:43 PM] asterix: I do gpg --list-keys, and I get that:
pub   1024D/65B95D84 2006-10-04
uid                  Verrier Anaël <elghinn@free.fr>
sub   4096g/6B100B00 2006-10-04
[Yesterday 08:31:47 PM] asterix: note the encoding pb
[Yesterday 08:32:20 PM] asterix: not I do gpg --list-keys --display-charset iso8859-15
and I Get:
pub   1024D/65B95D84 2006-10-04
uid                  Verrier Anaël <elghinn@free.fr>
sub   4096g/6B100B00 2006-10-04
[Yesterday 08:32:23 PM] asterix: no encoding pb
[Yesterday 08:32:27 PM] asterix: why that ??
[Yesterday 08:32:44 PM] asterix: now pb continues
[Yesterday 08:33:06 PM] asterix: in GnuPG.py we also use --with-colons option
[Yesterday 08:33:18 PM] asterix: in man I see:
       --with-colons
                 Print key listings delimited by colons.  Note that the output
                 will be encoded in UTF-8 regardless of any  --display-charset
                 setting.
[Yesterday 08:34:05 PM] asterix: so of course gpg --list-keys --with-colons gives me bad encoding:
pub:-:1024:17:B2B0958A65B95D84:2006-10-04:::-:Verrier Ana�x83«l <elghinn@free.fr>::scESC:
[Yesterday 08:34:14 PM] asterix: but man says it's utf-8 !!
[Yesterday 08:35:09 PM] asterix: and in GnuPG.py, when I get the gpg command output, if I do print line.decode('utf-8'), I gfet a TB:
  File "/home/asterix/gajim/src/common/GnuPG.py", line 188, in get_keys
    print sline[9].decode('utf-8')
  File "/usr/lib/python2.4/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 11-12: invalid data
[Yesterday 08:35:15 PM] asterix: do you have an idea about the pb ?
[Yesterday 08:46:27 PM] asterix: last thing you can see:
gpg --list-key --display-encoding utf-8 (same as without --display-encoding) doesn't return the same encoding as --with-colons

Yea, parsing CLI is not the best way to do those things, but apparently that lib does it that way (not python-gpgme patch and we had some issues with gpgme at that time [did not do all the features we needed).

so anyways, from those Yann says, I'm not sure it is our bug.

Changed 4 years ago by asterix

  • status changed from new to closed
  • resolution set to invalid

not sure where is the bug, but --with-colons MUST return utf-8, so pb is in thee key or in gpg

Add/Change #2529 (charset problem with gpg key)

Author


E-mail address and user name can be saved in the Preferences.


Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Next status will be 'needinfo'
 
Note: See TracTickets for help on using tickets.