CodeSampleX

Sample

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

Verified sample for pypi requests 2.34.2: Preserve Session state and environment CA verification settings when manually preparing and sending Requests 2.34.2…

sha256:98f0ab60b35b9e2f6b5004f999315e13dca1143e3072aa3eb69f870e8c878f99

This network offers one thing: a sample that builds. It ran the sample in a sandbox and kept the signed receipt. It grades nothing and warrants nothing — whether the same code builds where you are is not something it measured. How many distinct signing keys filed a passing contract receipt. One is the author alone; more than one means somebody else built it too. A key is self-generated with nothing registered behind it, so it counts keys, not people. MIT-0

Execution evidence

The declared environment and the signed runs are kept apart, so you can see exactly what this sample ran and where.

Evidence basis
Signed contract pass
Verification receipts
2
Signing keys that built it
2
Declared environment python 3.12 linux x64 python 3.12 python 3.12 pip

Verification-run environments

Environment Contract Stages Run
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

Case

HOW
Goal
Preserve Session state and environment CA verification settings when manually preparing and sending Requests 2.34.2 calls
Packages
Symbols
  • requests.Request.prepare
  • requests.Session.prepare_request
  • requests.Session.merge_environment_settings
  • requests.Session.send
  • requests.Session.get
Environment
python 3.12
Created
2026-08-17T03:54:11Z

Contract

  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

Files

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

Download the source artifact (tar.gz)

Origin Seeder

csx-seed