2017-04-26 108 views
1

我最近安装了Ubuntu 17.04,当我尝试添加一个ppa时,它给了这个回溯,指出了与idna.py有关的一些unicode错误(“label empty or too long”),如果它帮助我的网上代理上运行
unicode添加ppa到ubuntu时出错17.04

我进入下面的命令:

sudo -E apt-add-repository ppa:numix/ppa 

,并收到以下错误:

Traceback (most recent call last): 
    File "/usr/lib/python3.5/encodings/idna.py", line 165, in encode 
    raise UnicodeError("label empty or too long") 
UnicodeError: label empty or too long 

The above exception was the direct cause of the following exception: 

Traceback (most recent call last): 
    File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 358, in get_ppa_info 
    ret = get_ppa_info_from_lp(user, ppa) 
    File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 94, in get_ppa_info_from_lp 
    return get_info_from_lp(lp_url) 
    File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 88, in get_info_from_lp 
    return _get_https_content_py3(lp_url) 
    File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 112, in _get_https_content_py3 
    lp_page = urllib.request.urlopen(request, cafile=LAUNCHPAD_PPA_CERT) 
    File "/usr/lib/python3.5/urllib/request.py", line 163, in urlopen 
    return opener.open(url, data, timeout) 
    File "/usr/lib/python3.5/urllib/request.py", line 466, in open 
    response = self._open(req, data) 
    File "/usr/lib/python3.5/urllib/request.py", line 484, in _open 
    '_open', req) 
    File "/usr/lib/python3.5/urllib/request.py", line 444, in _call_chain 
    result = func(*args) 
    File "/usr/lib/python3.5/urllib/request.py", line 1297, in https_open 
    context=self._context, check_hostname=self._check_hostname) 
    File "/usr/lib/python3.5/urllib/request.py", line 1254, in do_open 
    h.request(req.get_method(), req.selector, req.data, headers) 
    File "/usr/lib/python3.5/http/client.py", line 1107, in request 
    self._send_request(method, url, body, headers) 
    File "/usr/lib/python3.5/http/client.py", line 1152, in _send_request 
    self.endheaders(body) 
    File "/usr/lib/python3.5/http/client.py", line 1103, in endheaders 
    self._send_output(message_body) 
    File "/usr/lib/python3.5/http/client.py", line 934, in _send_output 
    self.send(msg) 
    File "/usr/lib/python3.5/http/client.py", line 877, in send 
    self.connect() 
    File "/usr/lib/python3.5/http/client.py", line 1253, in connect 
    super().connect() 
    File "/usr/lib/python3.5/http/client.py", line 849, in connect 
    (self.host,self.port), self.timeout, self.source_address) 
    File "/usr/lib/python3.5/socket.py", line 694, in create_connection 
    for res in getaddrinfo(host, port, 0, SOCK_STREAM): 
    File "/usr/lib/python3.5/socket.py", line 733, in getaddrinfo 
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags): 
UnicodeError: encoding with 'idna' codec failed (UnicodeError: label empty or too long) 

During handling of the above exception, another exception occurred: 

Traceback (most recent call last): 
    File "/usr/lib/python3.5/encodings/idna.py", line 165, in encode 
    raise UnicodeError("label empty or too long") 
UnicodeError: label empty or too long 

The above exception was the direct cause of the following exception: 

Traceback (most recent call last): 
    File "/usr/bin/add-apt-repository", line 122, in <module> 
    shortcut = shortcut_handler(line) 
    File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 864, in shortcut_handler 
    ret = factory(shortcut) 
    File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 430, in shortcut_handler 
    return PPAShortcutHandler(shortcut) 
    File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 387, in __init__ 
    info = get_ppa_info(self.shortcut) 
    File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 370, in get_ppa_info 
    _get_suggested_ppa_message(user, ppa)) 
    File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 327, in _get_suggested_ppa_message 
    lp_user = get_info_from_lp(LAUNCHPAD_USER_API % user) 
    File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 88, in get_info_from_lp 
    return _get_https_content_py3(lp_url) 
    File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 112, in _get_https_content_py3 
    lp_page = urllib.request.urlopen(request, cafile=LAUNCHPAD_PPA_CERT) 
    File "/usr/lib/python3.5/urllib/request.py", line 163, in urlopen 
    return opener.open(url, data, timeout) 
    File "/usr/lib/python3.5/urllib/request.py", line 466, in open 
    response = self._open(req, data) 
    File "/usr/lib/python3.5/urllib/request.py", line 484, in _open 
    '_open', req) 
    File "/usr/lib/python3.5/urllib/request.py", line 444, in _call_chain 
    result = func(*args) 
    File "/usr/lib/python3.5/urllib/request.py", line 1297, in https_open 
    context=self._context, check_hostname=self._check_hostname) 
    File "/usr/lib/python3.5/urllib/request.py", line 1254, in do_open 
    h.request(req.get_method(), req.selector, req.data, headers) 
    File "/usr/lib/python3.5/http/client.py", line 1107, in request 
    self._send_request(method, url, body, headers) 
    File "/usr/lib/python3.5/http/client.py", line 1152, in _send_request 
    self.endheaders(body) 
    File "/usr/lib/python3.5/http/client.py", line 1103, in endheaders 
    self._send_output(message_body) 
    File "/usr/lib/python3.5/http/client.py", line 934, in _send_output 
    self.send(msg) 
    File "/usr/lib/python3.5/http/client.py", line 877, in send 
    self.connect() 
    File "/usr/lib/python3.5/http/client.py", line 1253, in connect 
    super().connect() 
    File "/usr/lib/python3.5/http/client.py", line 849, in connect 
    (self.host,self.port), self.timeout, self.source_address) 
    File "/usr/lib/python3.5/socket.py", line 694, in create_connection 
    for res in getaddrinfo(host, port, 0, SOCK_STREAM): 
    File "/usr/lib/python3.5/socket.py", line 733, in getaddrinfo 
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags): 
UnicodeError: encoding with 'idna' codec failed (UnicodeError: label empty or too long) 
+0

您需要提供更多信息才能真正帮助您。 “ppa”是什么意思?你的意思是[个人套餐存档](https://help.ubuntu.com/community/PPA)?您从该存档安装了哪些软件?他们的支持网站对安装错误有何评论? –

回答

0

这看起来不像是Unicode问题或Python问题。它看起来像PPA中的错误。

但您需要提供更多信息,让我们真正为您提供帮助。例如,您正在安装哪个PPA?它是否已成功安装在另一个系统上?

+0

我正在添加ppa:numix/ppa – pearlstar

+0

我建议您编辑问题以添加您正在安装的PPA的详细信息,以及其描述的链接。 –

+0

这是所有其他ppa的情况 – pearlstar