Skip to content

Commit 76a0dfa

Browse files
authored
[3.12] Workaround 3.12.5 bundled pip 24.2 issue on macOS 10.9 to 10.12. (#122774)
Workaround bundled pip 24.2 failures on macOS 10.9 to 10.12 installers. See pypa/pip#12901 for more information.
1 parent f4aad5a commit 76a0dfa

File tree

3 files changed

+100
-20
lines changed

3 files changed

+100
-20
lines changed

Mac/BuildScript/resources/ReadMe.rtf

+42-10
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
{\rtf1\ansi\ansicpg1252\cocoartf2709
1+
{\rtf1\ansi\ansicpg1252\cocoartf2761
22
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fswiss\fcharset0 Helvetica-Bold;\f2\fswiss\fcharset0 Helvetica-Oblique;
3-
\f3\fmodern\fcharset0 CourierNewPSMT;\f4\fmodern\fcharset0 Courier;}
4-
{\colortbl;\red255\green255\blue255;}
5-
{\*\expandedcolortbl;;}
3+
\f3\fmodern\fcharset0 CourierNewPSMT;\f4\fnil\fcharset0 .AppleSystemUIFontMonospaced-Regular;\f5\fmodern\fcharset0 Courier;
4+
}
5+
{\colortbl;\red255\green255\blue255;\red24\green26\blue30;\red244\green246\blue249;}
6+
{\*\expandedcolortbl;;\cssrgb\c12157\c13725\c15686;\cssrgb\c96471\c97255\c98039;}
67
\margl1440\margr1440\vieww13380\viewh14580\viewkind0
78
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
89

@@ -31,14 +32,33 @@ The bundled
3132
\f3 pip
3233
\f0 has its own default certificate store for verifying download connections.\
3334
\
35+
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
3436

35-
\f1\b \ul Install Options\
37+
\f1\b \cf0 \ul (Updated for 3.12.5):
38+
\f0\b0 \ulnone If you are using this installer on older, legacy versions of macOS, specifically
39+
\f1\b macOS 10.9 through 10.12
40+
\f0\b0 , the bundled version of
41+
\f1\b pip
42+
\f0\b0 (pip 24.2) included with this installer does not work correctly on these old versions of macOS.
43+
\f3 pip install
44+
\f0 commands may fail with a message similar to
45+
\f4\fs23\fsmilli11900 \cf2 \cb3 \expnd0\expndtw0\kerning0
46+
SecTrustEvaluateWithError: symbol not found.
47+
\f0\fs24 \cf0 \cb1 \kerning1\expnd0\expndtw0 (see {\field{\*\fldinst{HYPERLINK "https://github.com/pypa/pip/issues/12901"}}{\fldrslt https://github.com/pypa/pip/issues/12901}} for more information). To work around this issue, the
48+
\f3 Install Certificates
49+
\f0 command (described above) has been modified when running on these older macOS releases to attempt to first install an older version of pip that does not have this problem. You should avoid upgrading pip on these older systems until this problem has been resolved in a newer release of pip. If necessary, you can rerun
50+
\f3 Install Certificates
51+
\f0 at any time to attempt to revert to a working version of pip.\
52+
\
53+
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
54+
55+
\f1\b \cf0 \ul Install Options\
3656
3757
\f0\b0 \ulnone \
3858
You can control some aspects of what is installed by this package. To see the options, click on the
39-
\f4 Customize
59+
\f5 Customize
4060
\f0 button in the
41-
\f4 Installation Type
61+
\f5 Installation Type
4262
\f0 step of the macOS installer app. Click on a package name in the list shown to see more information about that option,\
4363
\
4464

@@ -64,13 +84,25 @@ Due to new security checks on macOS 10.15 Catalina, when launching IDLE macOS ma
6484
6585
\f0\b0 \ulnone \
6686
On Apple Silicon Macs, it is possible to run Python either with native ARM64 code or under Intel 64 emulation using Rosetta2. This option might be useful for testing or if binary wheels are not yet available with native ARM64 binaries. To easily force Python to run in emulation mode, invoke it from a command line shell with the
67-
\f4 python3-intel64
87+
\f5 python3-intel64
6888
\f0 command instead of just
69-
\f4 python3
89+
\f5 python3
7090
\f0 .\
7191

7292
\f1\b \ul \
73-
Other changes\
93+
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
94+
\cf0 Installer support for macOS 10.9 through 10.12 to be discontinued\
95+
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
96+
97+
\f0\b0 \cf0 \ulnone \
98+
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
99+
100+
\f1\b \cf0 \ul (Updated for 3.12.5):
101+
\f0\b0 \ulnone Up to now, python.org macOS installers have supported installation and running of Python 3.12.x on macOS releases as old as 10.9 Mavericks (which was first released in 2013). However, over time, it has become more difficult to continue supporting these older macOS releases. These operating system releases have long stopped receiving security updates and the most recent versions of Apple's Xcode developer tools no longer support building for these older systems, making it difficult for third-party developers to build and test their packages for them. We believe that only a very small and dwindling number of users are using these installers on these older macOS systems and thus believe that we can better serve the entire community by dropping support of these older macOS versions in future releases of Python 3.12.x installers. We have already announced that macOS installers for the next feature release of Python, 3.13, will initially support macOS 10.13 and newer releases. If you have a continued need for running Python 3.12 on these older systems, pre-built versions for these systems may be available from third-party distributors (such as MacPorts) or Python can be built from source ({\field{\*\fldinst{HYPERLINK "https://www.python.org/downloads/source/"}}{\fldrslt https://www.python.org/downloads/source/}}).\
102+
103+
\f1\b \ul \
104+
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
105+
\cf0 Other changes\
74106
75107
\f0\b0 \ulnone \
76108
For other changes in this release, see the

Mac/BuildScript/resources/Welcome.rtf

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{\rtf1\ansi\ansicpg1252\cocoartf2709
1+
{\rtf1\ansi\ansicpg1252\cocoartf2761
22
\cocoascreenfonts1\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fswiss\fcharset0 Helvetica-Bold;\f2\fmodern\fcharset0 CourierNewPSMT;
33
}
44
{\colortbl;\red255\green255\blue255;}
@@ -23,4 +23,13 @@
2323
At the end of this install, click on
2424
\f2 Install Certificates
2525
\f0 to install a set of current SSL root certificates.\
26+
\
27+
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
28+
29+
\f1\b \cf0 \ul \ulc0 Updated for 3.12.5:
30+
\f0\b0 \ulnone If you are using this installer on older, legacy versions of macOS, specifically
31+
\f1\b macOS 10.9 through 10.12
32+
\f0\b0 , be aware of a potential issue with newer versions of
33+
\f1\b pip
34+
\f0\b0 as described in the ReadMe. Also be aware that a future version of this installer will no longer support these legacy macOS versions.\
2635
}

Mac/BuildScript/resources/install_certificates.command

+48-9
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,52 @@
1010
1111
import os
1212
import os.path
13+
import platform
1314
import ssl
1415
import stat
1516
import subprocess
1617
import sys
1718
18-
STAT_0o775 = ( stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR
19-
| stat.S_IRGRP | stat.S_IWGRP | stat.S_IXGRP
20-
| stat.S_IROTH | stat.S_IXOTH )
19+
STAT_0o775 = (
20+
stat.S_IRUSR
21+
| stat.S_IWUSR
22+
| stat.S_IXUSR
23+
| stat.S_IRGRP
24+
| stat.S_IWGRP
25+
| stat.S_IXGRP
26+
| stat.S_IROTH
27+
| stat.S_IXOTH
28+
)
29+
2130
2231
def main():
23-
openssl_dir, openssl_cafile = os.path.split(
24-
ssl.get_default_verify_paths().openssl_cafile)
32+
pip_call = [sys.executable, "-E", "-s", "-m", "pip"]
33+
macos_release = tuple([int(n) for n in platform.mac_ver()[0].split(".")[0:2]])
34+
old_macos = macos_release < (10, 13)
35+
if old_macos:
36+
pip_version_string = subprocess.check_output(pip_call + ["-V"]).decode().strip()
37+
# Silence warning to user to upgrade pip
38+
pip_call.append("--disable-pip-version-check")
39+
pip_version = tuple(
40+
[int(n) for n in pip_version_string.split()[1].split(".")[0:2]]
41+
)
42+
if pip_version >= (24, 2):
43+
print(
44+
f" -- WARNING: this version of pip may not work on this older version of macOS.\n"
45+
f" found {pip_version_string}\n"
46+
f" (See https://github.com/pypa/pip/issues/12901 for more information.)\n"
47+
f" Attempting to revert to an older version of pip.\n"
48+
f" -- pip install --use-deprecated=legacy-certs pip==24.1.2\n"
49+
)
50+
subprocess.check_call(
51+
pip_call + ["install", "--use-deprecated=legacy-certs", "pip==24.1.2"]
52+
)
2553
54+
openssl_dir, openssl_cafile = os.path.split(
55+
ssl.get_default_verify_paths().openssl_cafile
56+
)
2657
print(" -- pip install --upgrade certifi")
27-
subprocess.check_call([sys.executable,
28-
"-E", "-s", "-m", "pip", "install", "--upgrade", "certifi"])
58+
subprocess.check_call(pip_call + ["install", "--upgrade", "certifi"])
2959
3060
import certifi
3161
@@ -42,7 +72,16 @@ def main():
4272
print(" -- setting permissions")
4373
os.chmod(openssl_cafile, STAT_0o775)
4474
print(" -- update complete")
75+
if old_macos:
76+
print(
77+
f" -- WARNING: Future releases of this Python installer may not support this older macOS version.\n"
78+
)
4579
46-
if __name__ == '__main__':
47-
main()
80+
81+
if __name__ == "__main__":
82+
try:
83+
main()
84+
except subprocess.SubprocessError:
85+
print(" -- WARNING: Install Certificates failed")
86+
sys.exit(1)
4887
EOF

0 commit comments

Comments
 (0)