Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Feature or enhancement
Proposal:
Support for anewline argument was added to thewrite_text method in Python 3.10 (issue#67894).
I've been using this method but I've found a need for anewline method forread_text as well.
Here's the scenario where this would be handy (namely reading and writing the original newlines):
frompathlibimportPathpath=Path("my_file.txt")contents=path.read_text(newline="")contents=perform_some_operation_on(contents)path.write_text(contents,newline="")
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
I have not found any prior discussions or mentions ofnewline argument being supported forread_text outside of the initial pathlib API discussion (#64417 (comment)).