Skip to content

Conversation

@manuzhang
Copy link
Member

@manuzhang manuzhang commented Aug 28, 2025

Rationale for this change

Request sessions could load REQUESTS_CA_BUNDLE or CURL_CA_BUNDLE from OS environment such that cabundle passed in from the UT is not used.
https://github.com/psf/requests/blob/88dce9d854797c05d0ff296b70e0430535ef8aaf/src/requests/sessions.py#L766-L771

Are these changes tested?

Yes

Are there any user-facing changes?

No

Comment on lines 1499 to 1502
if "REQUESTS_CA_BUNDLE" in os.environ:
os.environ.pop("REQUESTS_CA_BUNDLE")
if "CURL_CA_BUNDLE" in os.environ:
os.environ.pop("CURL_CA_BUNDLE")
Copy link
Contributor

@kevinjqliu kevinjqliu Aug 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:
I think os.environ.pop mutates the env vars. It might be better to use moneypatch.delenv here

WDYT?

@kevinjqliu
Copy link
Contributor

could you run the linter again? :)

Copy link
Contributor

@Fokko Fokko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Thanks for fixing this @manuzhang

@kevinjqliu kevinjqliu merged commit c3c314d into apache:main Aug 28, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants