You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Reject empty IDs and invalid numeric arguments when the client is built #1178
Resource getters accept any string. An empty ID fails only when the first request builds its URL: to_path_segment('') raises ValueError('"" cannot be used as a URL path segment.') (_utils/http.py#L50-L51, via _resource_client.py#L76-L82). The error appears far from the code that passed the empty ID and does not name the argument.
client.user('') does not fail at all. UserClient uses resource_id or 'me' (user.py#L33-L44), so client.user(os.environ.get('USER_ID', '')) silently reads the token owner's account.
Most numeric arguments are not checked either: a negative limit or offset, or a negative retry delay or timeout on the client, is passed on as is. Only max_retries is validated, by #1142.
Getters raise ValueError naming the argument when an ID is empty, at construction time. user('') raises, and only user() / user(None) means the current user. Client options (retry delays, timeouts) and pagination arguments (limit, offset) reject negative values. Request queue inputs are covered by #1093.
Activity