python-pip/disable-ssl-context-in-buildenv.patch
Dirk Mueller 593a4781e4 - update to 24.3.1:
* Allow multiple nested inclusions of the same requirements
    file again.
  * Deprecate wheel filenames that are not compliant with PEP
    440.
  * Detect recursively referencing requirements files and help
    users identify the source.
  * Support for PEP 730 iOS wheels.
  * Display a better error message when an already installed
    package has an invalid requirement.
  * Ignore PIP_TARGET and pip.conf global.target when preparing a
    build environment.
  * Restore support for macOS 10.12 and older (via truststore).
  * Allow installing pip in editable mode in a virtual
    environment on Windows.
  * Upgrade certifi to 2024.8.30
  * Upgrade distlib to 0.3.9
  * Upgrade truststore to 0.10.0
  * Upgrade urllib3 to 1.26.20

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pip?expand=0&rev=137
2024-10-30 08:10:27 +00:00

31 lines
1.2 KiB
Diff

Index: pip-24.2/src/pip/_vendor/requests/adapters.py
===================================================================
--- pip-24.2.orig/src/pip/_vendor/requests/adapters.py
+++ pip-24.2/src/pip/_vendor/requests/adapters.py
@@ -81,7 +81,7 @@ try:
_preloaded_ssl_context.load_verify_locations(
extract_zipped_paths(DEFAULT_CA_BUNDLE_PATH)
)
-except ImportError:
+except (ImportError, FileNotFoundError, ssl.SSLError):
# Bypass default SSLContext creation when Python
# interpreter isn't built with the ssl module.
_preloaded_ssl_context = None
Index: pip-24.2/src/pip/_internal/cli/index_command.py
===================================================================
--- pip-24.2.orig/src/pip/_internal/cli/index_command.py
+++ pip-24.2/src/pip/_internal/cli/index_command.py
@@ -43,7 +43,11 @@ def _create_truststore_ssl_context() ->
return None
ctx = truststore.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
- ctx.load_verify_locations(certifi.where())
+ try:
+ ctx.load_verify_locations(certifi.where())
+ except (FileNotFoundError, ssl.SSLError):
+ logger.warning("Disabling truststore because of missing certificates")
+ return None
return ctx