diff --git a/py3-certifi.yaml b/py3-certifi.yaml index 2620e4ff843..7a146b08b85 100644 --- a/py3-certifi.yaml +++ b/py3-certifi.yaml @@ -1,6 +1,6 @@ package: name: py3-certifi - version: "2025.04.26" + version: "2025.06.15" epoch: 0 description: Python3 package for providing Mozilla's CA Bundle copyright: @@ -46,7 +46,7 @@ pipeline: with: repository: https://github.com/certifi/python-certifi.git tag: ${{package.version}} - expected-commit: 275c9eb55733a464589c15fb4566fddd4598e5b2 + expected-commit: e767d5938eddddf804216cec93a55c85129c5f2d - uses: patch with: diff --git a/py3-certifi/use-alpine-system-certs.patch b/py3-certifi/use-alpine-system-certs.patch index 4693687d2f8..752789540b1 100644 --- a/py3-certifi/use-alpine-system-certs.patch +++ b/py3-certifi/use-alpine-system-certs.patch @@ -10,12 +10,12 @@ this package as a dependency for other packages without worries. This is based on the patch used by Debian diff --git a/certifi/core.py b/certifi/core.py -index de02898..9c0235f 100644 +index 1c9661c..32423f7 100644 --- a/certifi/core.py +++ b/certifi/core.py -@@ -6,13 +6,13 @@ This module returns the installation location of cacert.pem or its contents. - """ - import sys +@@ -10,13 +10,13 @@ import atexit + def exit_cacert_ctx() -> None: + _CACERT_CTX.__exit__(None, None, None) # type: ignore[union-attr] +ALPINE_CA_CERTS_PATH = '/etc/ssl/certs/ca-certificates.crt' @@ -29,7 +29,15 @@ index de02898..9c0235f 100644 def where() -> str: # This is slightly terrible, but we want to delay extracting the file -@@ -45,8 +45,7 @@ elif sys.version_info >= (3, 7): +@@ -44,14 +44,14 @@ if sys.version_info >= (3, 11): + return _CACERT_PATH + + def contents() -> str: +- return files("certifi").joinpath("cacert.pem").read_text(encoding="ascii") ++ with open(where(), "r", encoding="ascii") as data: ++ return data.read() + + else: from importlib.resources import path as get_path, read_text @@ -39,30 +47,10 @@ index de02898..9c0235f 100644 def where() -> str: # This is slightly terrible, but we want to delay extracting the -@@ -71,10 +70,11 @@ elif sys.version_info >= (3, 7): - _CACERT_CTX = get_path("certifi", "cacert.pem") - _CACERT_PATH = str(_CACERT_CTX.__enter__()) - -- return _CACERT_PATH -+ return ALPINE_CA_CERTS_PATH +@@ -80,4 +80,5 @@ else: + return _CACERT_PATH def contents() -> str: - return read_text("certifi", "cacert.pem", encoding="ascii") + with open(where(), "r", encoding="ascii") as data: + return data.read() - - else: - import os -@@ -100,9 +100,7 @@ else: - # If we don't have importlib.resources, then we will just do the old logic - # of assuming we're on the filesystem and munge the path directly. - def where() -> str: -- f = os.path.dirname(__file__) -- -- return os.path.join(f, "cacert.pem") -- -+ return ALPINE_CA_CERTS_PATH - def contents() -> str: -- return read_text("certifi", "cacert.pem", encoding="ascii") -+ with open(where(), "r", encoding="ascii") as data: -+ return data.read()