I had found following problem as I install packages of python on macOS Monterey(12.1) by using a third party script:
zipfile = ZipFile(StringIO(fp.read()))
.pyenv/versions/2.7.18/lib/python2.7/socket.py", line 355, in read
data = self._sock.recv(rbufsize)
.pyenv/versions/2.7.18/lib/python2.7/ssl.py", line 754, in recv
return self.read(buflen)
.pyenv/versions/2.7.18/lib/python2.7/ssl.py", line 641, in read
v = self._sslobj.read(len)
ssl.SSLError: [SSL: KRB5_S_TKT_NYV] unexpected eof while reading (_ssl.c:1946)
Briefly analysis for root-cause about this problem
openssl
to version 3.0.0 after macOS upgrading itself from BigSur to Monterey.Detail analysis for root-cause about this problem
OP_IGNORE_UNEXPECTED_EOF
for setting to relax handling behavior same as 1.1.0 and 1.0.2 .suppress_ragged_eofs = true
for setting handling behavior back to version 1.0.2 .
Please see below pictures
Please review discussion thread of python 3.9~3.11
=====
在 macOS Monterey(12.1) 作業系統上,我用第三方腳本安裝 python 套件可能會遇到以下問題:
zipfile = ZipFile(StringIO(fp.read()))
.pyenv/versions/2.7.18/lib/python2.7/socket.py", line 355, in read
data = self._sock.recv(rbufsize)
.pyenv/versions/2.7.18/lib/python2.7/ssl.py", line 754, in recv
return self.read(buflen)
.pyenv/versions/2.7.18/lib/python2.7/ssl.py", line 641, in read
v = self._sslobj.read(len)
ssl.SSLError: [SSL: KRB5_S_TKT_NYV] unexpected eof while reading (_ssl.c:1946)
問題原因概要分析
openssl
到 3.0.0 而產生的結果.問題原因詳細分析
OP_IGNORE_UNEXPECTED_EOF
,設定此選項能夠放鬆其處理行為到版號 1.1.0 和 1.0.2 。suppress_ragged_eofs = true
,讓 eof 處理行為回到 1.0.2 。
請參考以下圖片
參考 python 3.9~3.11 討論串