2017-04-26 81 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