-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
gh-110745: pathlib.Path.read_text add a newline argument #110880
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
Conversation
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Looking good! Could you also add a test in |
Thank you for your kind review! I apologize for the delayed response. As you suggested, I intend to add the appropriate tests. Please give me a moment. |
Only the test on Windows is failing. I wonder why... |
Implementing tests using Would it be appropriate to separate test cases for each OS? |
Regarding def test_read_text_with_newlines(self):
p = self.cls(BASE, 'fileA')
p.write_bytes(b'abcde\r\nfghlk\n\rmnopq')
self.assertEqual(p.read_text(newline=None), 'abcde\nfghlk\n\nmnopq')
self.assertEqual(p.read_text(newline=''), 'abcde\r\nfghlk\n\rmnopq')
self.assertEqual(p.read_text(newline='\r'), 'abcde\r\nfghlk\n\rmnopq')
self.assertEqual(p.read_text(newline='\n'), 'abcde\r\nfghlk\n\rmnopq')
self.assertEqual(p.read_text(newline='\r\n'), 'abcde\r\nfghlk\n\rmnopq') |
Thank you for your thoughtful comment!! I've implemented tests based on your feedback, and they now pass!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for my delayed feedback. Last thing to do is to fix the version number, and give yourself some credit in the changelog if you wish :)
Misc/NEWS.d/next/Library/2023-10-15-08-08-26.gh-issue-110745.mxEkh0.rst
Outdated
Show resolved
Hide resolved
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 |
Co-authored-by: Barney Gale <[email protected]>
…mxEkh0.rst Co-authored-by: Barney Gale <[email protected]>
Thank you for your kind review!! (I might not have mentioned properly. I am sorry for that) I accept your polite suggestion and am ready to merge this. Thank you. |
I have made the requested changes; please review again |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thank you very much!
…thon#110880) Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Barney Gale <[email protected]>
…thon#110880) Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Barney Gale <[email protected]>
📚 Documentation preview 📚: https://cpython-previews--110880.org.readthedocs.build/