add-apt-repository crashes on non-ascii names in PGP keys

Bug #1699086 reported by Rob Lazzurs
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
software-properties (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

When adding the PHP 7.1 repo into Ubuntu 16.04 LTS I get the following error.

Command;
add-apt-repository ppa:ondrej/php -y

Output;
gpg: keyring `/tmp/tmprs_t5_d6/secring.gpg' created
gpg: keyring `/tmp/tmprs_t5_d6/pubring.gpg' created
gpg: requesting key E5267A6C from hkp server keyserver.ubuntu.com
gpg: /tmp/tmprs_t5_d6/trustdb.gpg: trustdb created
gpg: key E5267A6C: public key "Launchpad PPA for Ond\xc5\x99ej Sur�" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
'ascii' codec can't decode byte 0xc5 in position 92: ordinal not in range(128)

The command exits with code 1.

Related branches

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package software-properties - 0.96.24.25

---------------
software-properties (0.96.24.25) bionic; urgency=medium

  * ppa.py:
   - rework key retrieval, instead of using hkp & gnupg/dirmngr, use https
     & python's built in urllib.
   - thus, add-apt-key for PPAs observes https_proxy for key retrieval
   - simplify gnupg operations, depend on gpg package only, and use
     import/public key operations only.
   - fix unicode process output bugs, when operating in a non-UTF-8
     locale, thus enabling to import keys for my ppas in C locale.
   - avoid creating trustdb, or requiring any gpg-agent systemd socket to
     be activated
   - update tests to execute key addition fully with less things stubbed
     out with mock
   - stop using apt-key for installing keys
   - dirmngr is a heavy dependency and not used, and it is hard to pass
     proxy information to it when invoking gpg from a non-standard homedir
   - deprecate --keyserver option, making HTTPS access to
     keyserver.ubuntu.com required
   - LP: #1755192, LP: #1713962, LP: #1699086, LP: #1510220, LP: #1433761,
     LP: #1395321, LP: #1312267

 -- Dimitri John Ledkov <email address hidden> Mon, 02 Apr 2018 10:19:34 +0100

Changed in software-properties (Ubuntu):
status: New → Fix Released
Revision history for this message
Bohumir Zamecnik (bzamecnik) wrote :

How is it possible to upgrade software-properties to 0.96.24.25 on Ubuntu Xenial? It contains only software-properties-common 0.96.20.8.

Revision history for this message
Bohumir Zamecnik (bzamecnik) wrote :

OK, not strictly necessary to upgrade. This workaround fixes the behavior: https://github.com/fideloper/docker-nginx-php/issues/15#issuecomment-303701864

```
LC_ALL=C.UTF-8 add-apt-repository ppa:username/repo
```

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.