Skip to content

Handle cookies dict set to prevent AttributeError #91

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rojoyin
Copy link

@rojoyin rojoyin commented Mar 12, 2025

Use merge_cookies instead of individual set_cookie calls when handling dictionary cookies. This ensures:

  • Consistent behavior across all cookie types (dict, list, RequestsCookieJar)
  • Better handling of cookie merging and potential conflicts
  • Proper domain and path handling through merge_cookies function

Open issue: #90

Use merge_cookies instead of individual set_cookie calls when handling
dictionary cookies. This ensures:
- Consistent behavior across all cookie types (dict, list, RequestsCookieJar)
- Better handling of cookie merging and potential conflicts
- Proper domain and path handling through merge_cookies function
@rojoyin rojoyin changed the title Handle cookies dict correctly in Session.get() to prevent AttributeError Handle cookies dict correctly in Session.get() to prevent AttributeError Mar 12, 2025
@rojoyin rojoyin changed the title Handle cookies dict correctly in Session.get() to prevent AttributeError Handle cookies dict correctly in Session.get() to prevent AttributeError Mar 12, 2025
@rojoyin rojoyin changed the title Handle cookies dict correctly in Session.get() to prevent AttributeError Handle cookies dict set to prevent AttributeError Mar 12, 2025
elif isinstance(cookies, list):
merge_cookies(self.cookies, list_to_cookiejar(cookies))
elif isinstance(cookies, dict):
merge_cookies(self.cookies, cookiejar_from_dict(cookies))
Copy link
Author

Choose a reason for hiding this comment

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

This is the specific change

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.

1 participant