Skip to content

fix: respect session verify attribute in ArtifactPath constructor - #508

Open
heyncth wants to merge 1 commit into
devopshq:masterfrom
heyncth:fix/gh-500-session-verify
Open

fix: respect session verify attribute in ArtifactPath constructor#508
heyncth wants to merge 1 commit into
devopshq:masterfrom
heyncth:fix/gh-500-session-verify

Conversation

@heyncth

@heyncth heyncth commented Jul 25, 2026

Copy link
Copy Markdown

WHAT

Fix Session 'verify' attribute being ignored when constructing ArtifactPath

Root Cause

When passing a requests.Session with verify=False to ArtifactPath(), the constructor ignores the session's verify setting and defaults to True (or the config file value). This happens in both __new__ (Python <3.12) and __init__ (Python >=3.12) methods.

Solution

When a session is provided but verify is not explicitly passed as a keyword argument, inherit the verify value from the session object instead of falling through to the hardcoded default. Explicit verify kwargs still take precedence over the session.

Test Plan

import requests
from artifactory import ArtifactoryPath

session = requests.Session()
session.verify = False
path = ArtifactoryPath("http://example.com/artifactory/libs-release-local/foo", session=session)
assert path.verify is False, "Session verify should be inherited"

Fixes #500

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Session 'verify' attribute should override default verify value when constructing ArtifactPath

1 participant