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
Clarify pathlib.Path("filepath").read_text() #78500
Comments
This came out of the following posts: https://mail.python.org/pipermail/python-ideas/2018-August/052549.html Basically my request would be to change the documentation here: https://docs.python.org/3.7/library/pathlib.html#pathlib.Path.read_text I would like to add a note that the underlying file object itself is closed after the read_text() method is called. Maybe I'm just a little dense and it should be obvious that the functionality here would be different than open("filepath").read(), but given that thread I linked, I don't believe I'm the only one. |
How about if we add "The file is opened and then closed." before "The optional parameters have the same meaning as in open()." |
For what it's worth as the original opener of the bug report, I think Terry's recommendation clarifies things quite well. |
+1 to Terry's suggestion. I've reviewed xtreak's PR and it looks good to me. |
Marking this bug as fixed via #8645 |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: