Skip to content

Commit 4d4d10f

Browse files
authored
requests-oauthlib: add **kwargs to OAuth1Session.__init__ (#15980)
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.
1 parent 25d6821 commit 4d4d10f

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

stubs/requests-oauthlib/requests_oauthlib/oauth1_session.pyi

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from _typeshed import Incomplete
22
from logging import Logger
3-
from typing import TypeAlias, TypedDict, type_check_only
3+
from typing import Any, TypeAlias, TypedDict, type_check_only
44

55
import requests
66
from oauthlib.oauth1 import Client
@@ -48,9 +48,12 @@ class OAuth1Session(requests.Session):
4848
client_class: type[Client] | None = None,
4949
force_include_body: bool = False,
5050
*,
51+
decoding: str | None = "utf-8",
52+
realm=None,
5153
encoding: str = "utf-8",
5254
nonce=None,
5355
timestamp=None,
56+
**kwargs: Any, # passed to client_class's __init__
5457
) -> None: ...
5558

5659
@property

0 commit comments

Comments
 (0)