Traceback (most recent call last):
File "/home/user/.virtualenvs/mps-youtube/lib/python3.6/site-packages/pylast/__init__.py", line 944, in _download_response
conn.request(method="POST", url=host_subdir, body=data, headers=headers)
File "/usr/lib/python3.6/http/client.py", line 1239, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/lib/python3.6/http/client.py", line 1285, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/lib/python3.6/http/client.py", line 1234, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/lib/python3.6/http/client.py", line 1026, in _send_output
self.send(msg)
File "/usr/lib/python3.6/http/client.py", line 964, in send
self.connect()
File "/usr/lib/python3.6/http/client.py", line 1400, in connect
server_hostname=server_hostname)
File "/usr/lib/python3.6/ssl.py", line 407, in wrap_socket
_context=self, _session=session)
File "/usr/lib/python3.6/ssl.py", line 817, in __init__
self.do_handshake()
File "/usr/lib/python3.6/ssl.py", line 1077, in do_handshake
self._sslobj.do_handshake()
File "/usr/lib/python3.6/ssl.py", line 689, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:847)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/user/.virtualenvs/mps-youtube/lib/python3.6/site-packages/mps_youtube/commands/lastfm.py", line 36, in init_network
password_hash=password)
File "/home/user/.virtualenvs/mps-youtube/lib/python3.6/site-packages/pylast/__init__.py", line 716, in __init__
"user": "user/%(name)s",
File "/home/user/.virtualenvs/mps-youtube/lib/python3.6/site-packages/pylast/__init__.py", line 219, in __init__
self.session_key = sk_gen.get_session_key(self.username, self.password_hash)
File "/home/user/.virtualenvs/mps-youtube/lib/python3.6/site-packages/pylast/__init__.py", line 1092, in get_session_key
doc = request.execute()
File "/home/user/.virtualenvs/mps-youtube/lib/python3.6/site-packages/pylast/__init__.py", line 965, in execute
response = self._download_response()
File "/home/user/.virtualenvs/mps-youtube/lib/python3.6/site-packages/pylast/__init__.py", line 946, in _download_response
raise NetworkError(self.network, e)
pylast.NetworkError: NetworkError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:847)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/mpsyt", line 10, in <module>
sys.exit(main.main())
File "/home/user/.virtualenvs/mps-youtube/lib/python3.6/site-packages/mps_youtube/main.py", line 148, in main
if matchfunction(i.function, i.regex, userinput):
File "/home/user/.virtualenvs/mps-youtube/lib/python3.6/site-packages/mps_youtube/main.py", line 65, in matchfunction
func(*matches)
File "/home/user/.virtualenvs/mps-youtube/lib/python3.6/site-packages/mps_youtube/commands/lastfm.py", line 41, in init_network
g.message = "Last.fm connection error: %s" % (str(e))
NameError: name 'e' is not defined
Issue / Suggestion
lastfm_connect
Expected: mpsyt successfully connects to last.fm
Observed: app crash with exit code 1
My employer blocks access to last.fm:
Seems like adding
last.fm
to/etc/hosts
would reproduce the issue.I'm suggesting to add
ssl.SSLError
handling incommands.lastfm.init_network()
except
block.Your Environment