Skip to content

Commit 677a31f

Browse files
committed
requests-oauthlib: add **kwargs to OAuth1Session.__init__
At runtime OAuth1Session.__init__ forwards **kwargs straight through to OAuth1(...) (see requests_oauthlib/oauth1_session.py), which already has extra keyword-only params typed in oauth1_auth.pyi (e.g. realm). The OAuth1Session stub was missing the passthrough, so legitimate calls like OAuth1Session(client_key=..., realm=...) failed with a spurious "No parameter named realm" error. Sibling methods on the same class (authorization_url, fetch_request_token, fetch_access_token) already use a bare **kwargs for the same reason. Verified with tests/stubtest_third_party.py, tests/mypy_test.py (all supported Python versions), and pre-commit (ruff/black/flake8-pyi).
1 parent a7bcce8 commit 677a31f

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

stubs/requests-oauthlib/requests_oauthlib/oauth1_session.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ class OAuth1Session(requests.Session):
5151
encoding: str = "utf-8",
5252
nonce=None,
5353
timestamp=None,
54+
**kwargs,
5455
) -> None: ...
5556

5657
@property

0 commit comments

Comments
 (0)