Guest User

Untitled

a guest
Oct 20th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.09 KB | None | 0 0
  1. #Used to make requests
  2. import urllib.request
  3.  
  4. x = urllib.request.urlopen('https://www.google.com/')
  5. print(x.read())
  6.  
  7. Traceback (most recent call last):
  8. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 1317, in do_open
  9. encode_chunked=req.has_header('Transfer-encoding'))
  10. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 1229, in request
  11. self._send_request(method, url, body, headers, encode_chunked)
  12. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 1275, in _send_request
  13. self.endheaders(body, encode_chunked=encode_chunked)
  14. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 1224, in endheaders
  15. self._send_output(message_body, encode_chunked=encode_chunked)
  16. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 1016, in _send_output
  17. self.send(msg)
  18. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 956, in send
  19. self.connect()
  20. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 1392, in connect
  21. server_hostname=server_hostname)
  22. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 412, in wrap_socket
  23. session=session
  24. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 850, in _create
  25. self.do_handshake()
  26. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 1108, in do_handshake
  27. self._sslobj.do_handshake()
  28. ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1045)
  29.  
  30. During handling of the above exception, another exception occurred:
  31.  
  32. Traceback (most recent call last):
  33. File "/Users/charlesgraham/Dropbox/2018 Fall/CS1030 Intro to Computer Programming/Homework Submission Aug 29/downloadingImages.py", line 4, in <module>
  34. x = urllib.request.urlopen('https://www.google.com/')
  35. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 222, in urlopen
  36. return opener.open(url, data, timeout)
  37. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 525, in open
  38. response = self._open(req, data)
  39. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 543, in _open
  40. '_open', req)
  41. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 503, in _call_chain
  42. result = func(*args)
  43. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 1360, in https_open
  44. context=self._context, check_hostname=self._check_hostname)
  45. File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 1319, in do_open
  46. raise URLError(err)
  47. urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1045)>
Add Comment
Please, Sign In to add comment