Skip to content
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

The definition of LooseCookies is too narrow #4205

Closed
serhiy-storchaka opened this issue Oct 17, 2019 · 10 comments · Fixed by #4218
Closed

The definition of LooseCookies is too narrow #4205

serhiy-storchaka opened this issue Oct 17, 2019 · 10 comments · Fixed by #4218
Labels
good first issue Good for newcomers Hacktoberfest We think it's good for https://hacktoberfest.digitalocean.com/ pr-merged

Comments

@serhiy-storchaka
Copy link
Contributor

Seems both CookieJar.update_cookies() and ClientRequest.update_cookies() accept also Iterable[Tuple[str, Union[Morsel, str]] and Mapping[str, Union[Morsel, str]].

The definition of LooseCookies which does not include the above types is not compatible with existing user code.

@asvetlov asvetlov added good first issue Good for newcomers Hacktoberfest We think it's good for https://hacktoberfest.digitalocean.com/ labels Oct 17, 2019
@asvetlov
Copy link
Member

Agree. Good first-time issue.
Any volunteer?

@punndcoder28
Copy link

Hey! Can I work on this? What is to be done exactly?

asvetlov pushed a commit that referenced this issue Oct 18, 2019
* add more types to LooseCookies #4205

* predefine the Union types for LooseCookies

* add CHANGES fragment
@helpr helpr bot added pr-merged and removed pr-rejected labels Oct 18, 2019
asvetlov pushed a commit that referenced this issue Oct 18, 2019
* add more types to LooseCookies #4205

* predefine the Union types for LooseCookies

* add CHANGES fragment
(cherry picked from commit e048934)

Co-authored-by: Adam Bannister <adam.p.bannister@gmail.com>
@serhiy-storchaka
Copy link
Contributor Author

What about Iterable[Tuple[str, str]] and Mapping[str, str]?.

@asvetlov asvetlov reopened this Oct 18, 2019
@serhiy-storchaka
Copy link
Contributor Author

Would be nice to add test cases for update_cookies() with different types of arguments.

@asvetlov
Copy link
Member

@serhiy-storchaka thanks for the note.
@AtomsForPeace would you create a follow-up PR?

asvetlov added a commit that referenced this issue Oct 18, 2019
* add more types to LooseCookies #4205

* predefine the Union types for LooseCookies

* add CHANGES fragment
(cherry picked from commit e048934)

Co-authored-by: Adam Bannister <adam.p.bannister@gmail.com>
@AtomsForPeace
Copy link
Contributor

Sure thing

@AtomsForPeace
Copy link
Contributor

So I added the extra two types mentioned and added a test for CookieJar.update_cookies. Should I add a test for ClientRequest.update_cookies too or is that unnecessary?

@serhiy-storchaka
Copy link
Contributor Author

They use similar but independent code, so testing ClientRequest.update_cookies is not redundant.

@AtomsForPeace
Copy link
Contributor

Ok, I'll try find time to add it this evening. Thanks for the feedback

@asvetlov
Copy link
Member

Fixed, I think.
Please feel free to open a new issue if something is not covered still

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers Hacktoberfest We think it's good for https://hacktoberfest.digitalocean.com/ pr-merged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants