Skip to content

Commit b53c5e8

Browse files
authored
Merge branch 'main' into exclude-newer-than
2 parents 007caf6 + d52011f commit b53c5e8

File tree

7 files changed

+24
-16
lines changed

7 files changed

+24
-16
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
runs-on: ubuntu-22.04
2929

3030
steps:
31-
- uses: actions/checkout@v4
31+
- uses: actions/checkout@v5
3232
- uses: actions/setup-python@v5
3333
with:
3434
python-version: "3.x"
@@ -70,7 +70,7 @@ jobs:
7070
os: [ubuntu-22.04, windows-latest]
7171

7272
steps:
73-
- uses: actions/checkout@v4
73+
- uses: actions/checkout@v5
7474
- uses: actions/setup-python@v5
7575
with:
7676
python-version: "3.x"
@@ -94,7 +94,7 @@ jobs:
9494
github.event_name != 'pull_request'
9595
9696
steps:
97-
- uses: actions/checkout@v4
97+
- uses: actions/checkout@v5
9898
- uses: actions/setup-python@v5
9999
with:
100100
python-version: "3.x"
@@ -125,7 +125,7 @@ jobs:
125125
- "3.14"
126126

127127
steps:
128-
- uses: actions/checkout@v4
128+
- uses: actions/checkout@v5
129129
- uses: actions/setup-python@v5
130130
with:
131131
python-version: ${{ matrix.python }}
@@ -195,7 +195,7 @@ jobs:
195195
mkdir "D:\\Temp"
196196
echo "TEMP=D:\\Temp" >> $env:GITHUB_ENV
197197
198-
- uses: actions/checkout@v4
198+
- uses: actions/checkout@v5
199199
- uses: actions/setup-python@v5
200200
with:
201201
python-version: ${{ matrix.python }}
@@ -230,7 +230,7 @@ jobs:
230230
github.event_name != 'pull_request'
231231
232232
steps:
233-
- uses: actions/checkout@v4
233+
- uses: actions/checkout@v5
234234
- uses: actions/setup-python@v5
235235
with:
236236
python-version: "3.10"

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
14+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
1515
with:
1616
persist-credentials: false
1717
- name: Build a binary wheel and a source tarball
@@ -36,7 +36,7 @@ jobs:
3636

3737
steps:
3838
- name: Download all the dists
39-
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
39+
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
4040
with:
4141
name: python-package-distributions
4242
path: dist/

.github/workflows/update-rtd-redirects.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
runs-on: ubuntu-latest
2222
environment: RTD Deploys
2323
steps:
24-
- uses: actions/checkout@v4
24+
- uses: actions/checkout@v5
2525
- uses: actions/setup-python@v5
2626
with:
2727
python-version: "3.11"

news/truststore.vendor.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Upgrade truststore to 0.10.3
1+
Upgrade truststore to 0.10.4

src/pip/_vendor/truststore/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@
3333
del _api, _sys # type: ignore[name-defined] # noqa: F821
3434

3535
__all__ = ["SSLContext", "inject_into_ssl", "extract_from_ssl"]
36-
__version__ = "0.10.3"
36+
__version__ = "0.10.4"

src/pip/_vendor/truststore/_api.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
import contextlib
12
import os
23
import platform
34
import socket
45
import ssl
56
import sys
7+
import threading
68
import typing
79

810
import _ssl
@@ -84,6 +86,7 @@ def __class__(self) -> type:
8486

8587
def __init__(self, protocol: int = None) -> None: # type: ignore[assignment]
8688
self._ctx = _original_SSLContext(protocol)
89+
self._ctx_lock = threading.Lock()
8790

8891
class TruststoreSSLObject(ssl.SSLObject):
8992
# This object exists because wrap_bio() doesn't
@@ -106,10 +109,15 @@ def wrap_socket(
106109
server_hostname: str | None = None,
107110
session: ssl.SSLSession | None = None,
108111
) -> ssl.SSLSocket:
109-
# Use a context manager here because the
110-
# inner SSLContext holds on to our state
111-
# but also does the actual handshake.
112-
with _configure_context(self._ctx):
112+
113+
# We need to lock around the .__enter__()
114+
# but we don't need to lock within the
115+
# context manager, so we need to expand the
116+
# syntactic sugar of the `with` statement.
117+
with contextlib.ExitStack() as stack:
118+
with self._ctx_lock:
119+
stack.enter_context(_configure_context(self._ctx))
120+
113121
ssl_sock = self._ctx.wrap_socket(
114122
sock,
115123
server_side=server_side,

src/pip/_vendor/vendor.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ resolvelib==1.2.0
1515
setuptools==70.3.0
1616
tomli==2.2.1
1717
tomli-w==1.2.0
18-
truststore==0.10.3
18+
truststore==0.10.4
1919
dependency-groups==1.3.1

0 commit comments

Comments
 (0)