Skip to content

bpo-36043: FileCookieJar supports os.PathLike#11945

Merged
miss-islington merged 10 commits into
python:masterfrom
matrixise:bpo-36043
Mar 1, 2019
Merged

bpo-36043: FileCookieJar supports os.PathLike#11945
miss-islington merged 10 commits into
python:masterfrom
matrixise:bpo-36043

Conversation

@matrixise

@matrixise matrixise commented Feb 19, 2019

Copy link
Copy Markdown
Member

@tirkarthi tirkarthi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the PR.

@matrixise

Copy link
Copy Markdown
Member Author

@tirkarthi done, could you review again? thanks

Comment thread Lib/http/cookiejar.py Outdated
Comment thread Doc/library/http.cookiejar.rst Outdated

.. versionchanged:: 3.8

The filename parameter supports a :class:`~pathlib.Path` instance.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As noted below this can be anything that implements fspath and not only pathlib.Path instance. Please use path-like object term with markup (:term:path-like object)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

updated

Comment thread Doc/library/http.cookiejar.rst Outdated

.. versionchanged:: 3.8

The filename parameter supports a :class:`~pathlib.Path` instance.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please use path-like object as below

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

updated

@tirkarthi tirkarthi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Thanks 👍

@JulienPalard

Copy link
Copy Markdown
Member

Out of curiosity, why inverting the if and the try? It just make the diff bigger from my point of view.

@matrixise

Copy link
Copy Markdown
Member Author

@JulienPalard good catch, thank you, just updated with your recommendation.

@matrixise

Copy link
Copy Markdown
Member Author

Because I stopped to raise an ValueError, I suppose I should update the documentation and indicate that we raise a TypeError

Comment thread Lib/test/test_http_cookiejar.py Outdated
filename = test.support.TESTFN
c = LWPCookieJar(filename)
self.assertEqual(c.filename, filename)
self.assertIsInstance(c.filename, str)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are the type checks necessary? Unless the docs explicitly state that then I don't think they are necessary.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

no, they are not necessary, I have removed them. Thank you for your review.

Comment thread Lib/test/test_http_cookiejar.py Outdated
@bedevere-bot

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

And if you don't make the requested changes, you will be poked with soft cushions!

@matrixise matrixise changed the title bpo-36043: FileCookieJar supports pathlib.Path bpo-36043: FileCookieJar supports os.PathLike Feb 21, 2019
@matrixise

Copy link
Copy Markdown
Member Author

@brettcannon if you want to continue your review, thank you.

@brettcannon

Copy link
Copy Markdown
Member

@matrixise you forgot to ask Bedevere to mark this as ready to be reviewed again. 😄 Otherwise it doesn't end up in my review queue.

@matrixise

Copy link
Copy Markdown
Member Author

I have made the requested changes; please review again

@bedevere-bot

Copy link
Copy Markdown

Thanks for making the requested changes!

@brettcannon: please review the changes made to this pull request.

@matrixise

Copy link
Copy Markdown
Member Author

useful this very small sentence for @bedevere-bot ;-)

@brettcannon

Copy link
Copy Markdown
Member

@matrixise thanks!

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.

7 participants