profile
viewpoint

Ask questionspython3 get-poetry.py get some errors

<!-- Hi there! Thank you for discovering and submitting an issue.

Before you submit this; let's make sure of a few things. Please make sure the following boxes are ticked if they are correct. If not, please try and fulfill these first. -->

<!-- Checked checkbox should look like this: [x] -->

  • [ ] I am on the latest Poetry version.
  • [x] I have searched the issues of this repo and believe that this is not a duplicate.
  • [ ] If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

<!-- Once those are done, if you're able to fill in the following list with your information, it'd be very helpful to whoever handles the issue. -->

  • OS version and name: macOS Big Sur 11.4
  • Poetry version: <!-- Replace with version -->
  • Link of a Gist with the contents of your pyproject.toml file: <!-- Gist Link Here -->

Issue

<!-- Now feel free to write your issue, but please be descriptive! Thanks again 🙌 ❤️ -->

Hi, when i use the get-poetry.py to reinstall poetry I got some errors, urllib.error.URLError: <urlopen error EOF occurred in violation of protocol (_ssl.c:1108)>

╰─○ python3 get-poetry.py
Retrieving Poetry metadata
Traceback (most recent call last):
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 1319, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/http/client.py", line 1245, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/http/client.py", line 1291, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/http/client.py", line 1240, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/http/client.py", line 1008, in _send_output
    self.send(msg)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/http/client.py", line 948, in send
    self.connect()
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/http/client.py", line 1414, in connect
    self.sock = self._context.wrap_socket(self.sock,
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/ssl.py", line 1040, in _create
    self.do_handshake()
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:1108)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "get-poetry.py", line 1085, in <module>
    sys.exit(main())
  File "get-poetry.py", line 1081, in main
    return installer.run()
  File "get-poetry.py", line 324, in run
    version, current_version = self.get_version()
  File "get-poetry.py", line 387, in get_version
    metadata = json.loads(self._get(self.METADATA_URL).decode())
  File "get-poetry.py", line 998, in _get
    with closing(urlopen(request)) as r:
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 525, in open
    response = self._open(req, data)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 542, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 1362, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 1322, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error EOF occurred in violation of protocol (_ssl.c:1108)>

So what can i do to reinstall it?

python-poetry/poetry

Answer questions jeffcasavant

I have python 3.8.10 installed with ASDF on MacOS 11.2.3.

You can replicate this issue with urllib itself, so it's not a Poetry problem, but instead a problem with our Python distributions (which I haven't tracked down yet).

import urllib.request
urllib.request.urlopen("https://google.com")
useful!
source:https://uonfu.com/
Github User Rank List