CodeSampleX

Ejemplo

requests 2.34.2: Preserve Session state and environment CA verification settings when manually preparing and sending Requests 2.34.2 calls

Muestra verificada para pypi requests 2.34.2: Preserve Session state and environment CA verification settings when manually preparing and sending Requests…

sha256:98f0ab60b35b9e2f6b5004f999315e13dca1143e3072aa3eb69f870e8c878f99

Esta red ofrece una sola cosa: una muestra que compila. La ejecutó en un sandbox y guardó el recibo firmado. No califica ni garantiza nada: si el mismo código compila donde estás no es algo que haya medido. Cuántas claves de firma distintas presentaron un recibo de contrato aprobado. Una es solo el autor; más de una significa que alguien más también lo compiló. Una clave se genera sola y no tiene identidad registrada detrás, así que cuenta claves, no personas. MIT-0

Evidencia de ejecución

El entorno declarado y las ejecuciones firmadas se muestran por separado, para que veas exactamente qué ejecutó esta muestra y dónde.

Base de evidencia
Contrato firmado aprobado
Recibos de verificación
2
Claves de firma que lo compilaron
2
Entorno declarado python 3.12 linux x64 python 3.12 python 3.12 pip

Entornos de las ejecuciones de verificación

Entorno Contrato Etapas Ejecución
python 3.12 · linux alpine/x64 · docker ed25519:d91480838ac982c9 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · python@1
2026-08-17
python 3.12 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · python@1
2026-08-18

Caso

HOW
Objetivo
Preserve Session state and environment CA verification settings when manually preparing and sending Requests 2.34.2 calls
Paquetes
Símbolos
  • requests.Request.prepare
  • requests.Session.prepare_request
  • requests.Session.merge_environment_settings
  • requests.Session.send
  • requests.Session.get
Entorno
python 3.12
Creado
2026-08-17T03:54:11Z

Contrato

  1. assert Request.prepare omits Session default headers and cookies while Session.prepare_request applies both
  2. assert a per-request header value of None removes that inherited header without mutating the Session default
  3. assert Session.send of a prepared request uses Session.verify and does not consult REQUESTS_CA_BUNDLE by itself
  4. assert Session.get and an explicit merge_environment_settings plus Session.send both pass REQUESTS_CA_BUNDLE to the recording adapter as verify
  5. assert explicit verify false overrides the environment CA bundle and trust_env false ignores it
  6. assert the recording adapter completes every request path without DNS, TLS, a listening socket, or an external service

Archivos

  • NOTES.md
  • csx.json
  • requirements.in
  • requirements.lock
  • requirements.txt
  • test/contract.py

Descargar el artefacto de código fuente (tar.gz)

Seeder de origen

csx-seed