UnicodeDecodeError when adding a ppa with add-apt-repository

Bug #559008 reported by Rickard Närström
80
This bug affects 16 people
Affects Status Importance Assigned to Milestone
software-properties (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

$ sudo add-apt-repository ppa:riccetn/aegisub
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.6/threading.py", line 532, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.6/dist-packages/softwareproperties/ppa.py", line 59, in run
    self.add_ppa_signing_key(self.ppa_path)
  File "/usr/lib/python2.6/dist-packages/softwareproperties/ppa.py", line 87, in add_ppa_signing_key
    print "Error reading %s: %s" % (lp_url, e)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 39: ordinal not in range(128)

The repository is added:
$ cat /etc/apt/sources.list.d/riccetn-aegisub-lucid.list
deb http://ppa.launchpad.net/riccetn/aegisub/ubuntu lucid main

The key is not:
$ sudo apt-key list
/etc/apt/trusted.gpg
--------------------
pub 1024D/437D05B5 2004-09-12
uid Ubuntu Archive Automatic Signing Key <email address hidden>
sub 2048g/79164387 2004-09-12

pub 1024D/FBB75451 2004-12-30
uid Ubuntu CD Image Automatic Signing Key <email address hidden>

Works fine in en_US.UTF-8 locale:
$ LC_ALL=en_US.UTF-8 sudo add-apt-repository ppa:riccetn/aegisubExecuting: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /etc/apt/secring.gpg --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver keyserver.ubuntu.com --recv A8AB12C6D9D6695D11C6D61DFCBFDF60D7BFC706
gpg: requesting key D7BFC706 from hkp server keyserver.ubuntu.com
gpg: key D7BFC706: public key "Launchpad Aegisub PPA by riccetn" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)

$ locale
LANG=sv_SE.utf8
LC_CTYPE="sv_SE.utf8"
LC_NUMERIC="sv_SE.utf8"
LC_TIME="sv_SE.utf8"
LC_COLLATE="sv_SE.utf8"
LC_MONETARY="sv_SE.utf8"
LC_MESSAGES="sv_SE.utf8"
LC_PAPER="sv_SE.utf8"
LC_NAME="sv_SE.utf8"
LC_ADDRESS="sv_SE.utf8"
LC_TELEPHONE="sv_SE.utf8"
LC_MEASUREMENT="sv_SE.utf8"
LC_IDENTIFICATION="sv_SE.utf8"
LC_ALL=

$ lsb_release -rd
Description: Ubuntu lucid (development branch)
Release: 10.04

$ LC_ALL=en_US.UTF-8 apt-cache policy python-software-properties
python-software-properties:
  Installed: 0.75.9
  Candidate: 0.75.9
  Version table:
 *** 0.75.9 0
        500 http://se.archive.ubuntu.com/ubuntu/ lucid/main Packages
        100 /var/lib/dpkg/status

Revision history for this message
Rickard Närström (riccetn) wrote :

My internet connection was a little bit unstable when I did this. The bug may be releted to printing out an localized error message (DNS error or timeout)

Revision history for this message
guillaume le louet (guillaume-lelouet) wrote :

are you behind a proxy?

Revision history for this message
Johan Walles (walles) wrote :

Guillaume, this does affect me and I am behind a proxy.

If I run as root and unset LANG I get:
root@transwarp:/tmp# add-apt-repository ppa:deb-thumbnailer-team/ppa
Error reading https://launchpad.net/api/1.0/~deb-thumbnailer-team/+archive/ppa: <urlopen error [Errno 113] No route to host>

I am behind a proxy, but I have entered my proxy settings in System / Network Proxy Server and "applied them for the whole system". Since wget works, they should be correct.

Revision history for this message
Kurt Kraut (kurtkraut) wrote :

It is also happening to me in Ubuntu 10.10 and it seems to happen in computers that need proxy to access internet. I've configured my proxy in Gnome and set it to be applied system-wide. All applications are working properly with the proxy (like aptitude) but add-apt-repository gives the same error.

Revision history for this message
Henning Moll (drscott) wrote :

The Problem is, that there is an exception with the following (german) message:

<urlopen error [Errno 110] Die Wartezeit für die Verbindung ist abgelaufen>

(which is "connection timed out")
As the message contains an german umlaut "ü", there is an follow up exception

UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 42: ordinal not in range(128)

Why does this python code work in ascii-mode?

Revision history for this message
LE DISEZ Erwan (7-dev-g) wrote :

Same problem on Ubuntu 11.04, when adding a repo :

# add-apt-repository ppa:am-monkeyd/nautilus-elementary-ppa
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/dist-packages/softwareproperties/ppa.py", line 63, in run
    self.add_ppa_signing_key(self.ppa_path)
  File "/usr/lib/python2.7/dist-packages/softwareproperties/ppa.py", line 93, in add_ppa_signing_key
    print "Error reading %s: %s" % (lp_url, e)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 42: ordinal not in range(128)

I'am behind a proxy :

# cat /etc/apt/apt.conf
ACQUIRE {
http::proxy "http://172.16.0.63:8080"
}

The locales are :
# locale
LANG=fr_FR.UTF-8
LANGUAGE=fr:en
LC_CTYPE="fr_FR.UTF-8"
LC_NUMERIC="fr_FR.UTF-8"
LC_TIME="fr_FR.UTF-8"
LC_COLLATE="fr_FR.UTF-8"
LC_MONETARY="fr_FR.UTF-8"
LC_MESSAGES=fr_FR.UTF-8
LC_PAPER="fr_FR.UTF-8"
LC_NAME="fr_FR.UTF-8"
LC_ADDRESS="fr_FR.UTF-8"
LC_TELEPHONE="fr_FR.UTF-8"
LC_MEASUREMENT="fr_FR.UTF-8"
LC_IDENTIFICATION="fr_FR.UTF-8"
LC_ALL=

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

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in software-properties (Ubuntu):
status: New → Confirmed
Revision history for this message
Robert Roth (evfool) wrote :

Is this still an issue with Oneiric? I have tried with the latest development issue, and adding the PPAs listed in this bug works as expected, so I would say this has been fixed and should be set as such.
---
Ubuntu Bug Squad volunteer triager
http://wiki.ubuntu.com/BugSquad

Changed in software-properties (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for software-properties (Ubuntu) because there has been no activity for 60 days.]

Changed in software-properties (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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