This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Path.write_text() docs do not include the case that a file exists
Type: Stage: resolved
Components: Documentation Versions: Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, lys.nikolaou, mdk, methane, xtreak
Priority: normal Keywords: patch

Created on 2019-03-04 12:51 by lys.nikolaou, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 12161 merged lys.nikolaou, 2019-03-04 13:22
PR 15977 merged miss-islington, 2019-09-11 15:08
Messages (8)
msg337100 - (view) Author: Lysandros Nikolaou (lys.nikolaou) * (Python committer) Date: 2019-03-04 12:51
Hi,

in the pathlib.Path.write_bytes() documentation it is clearly stated that "An existing file of the same name is overwritten." Wouldn't it make sense to include something similar to the pathlib.Path.write_text() docs. I had to quickly test it manually to find out what's happening as it wasn't clear to me if the statement applies to write_text() as well.
msg337101 - (view) Author: Lysandros Nikolaou (lys.nikolaou) * (Python committer) Date: 2019-03-04 12:51
For reference, https://docs.python.org/3/library/pathlib.html#pathlib.Path.write_bytes.
msg337106 - (view) Author: Inada Naoki (methane) * (Python committer) Date: 2019-03-04 13:02
It may be removed accidentally by this commit.

https://github.com/python/cpython/commit/8477ed60486a22f79f257ee49f0bc18d0e73f216#diff-56cd2f82cd518e7baf1edab64771f619
msg337108 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2019-03-04 13:07
I was searching along similar lines since this was present as part of the original commit : https://hg.python.org/cpython/rev/a4da150fbfd4 . I guess it makes sense to restore the text.
msg337111 - (view) Author: Lysandros Nikolaou (lys.nikolaou) * (Python committer) Date: 2019-03-04 13:12
I'll submit a PR shortly.
msg348164 - (view) Author: Lysandros Nikolaou (lys.nikolaou) * (Python committer) Date: 2019-07-19 10:56
Pinging for review.
msg351923 - (view) Author: Julien Palard (mdk) * (Python committer) Date: 2019-09-11 15:08
New changeset af636f4f91b8289b6dad95cb84123f6e22fd7f4f by Julien Palard (Lysandros Nikolaou) in branch 'master':
bpo-36182: Update pathlib.Path.write_text() docs (GH-12161)
https://github.com/python/cpython/commit/af636f4f91b8289b6dad95cb84123f6e22fd7f4f
msg351954 - (view) Author: Julien Palard (mdk) * (Python committer) Date: 2019-09-11 15:55
New changeset 893653357cc83d49049debfeb9074a4ce99cd478 by Julien Palard (Miss Islington (bot)) in branch '3.8':
bpo-36182: Update pathlib.Path.write_text() docs (GH-12161) (GH-15977)
https://github.com/python/cpython/commit/893653357cc83d49049debfeb9074a4ce99cd478
History
Date User Action Args
2022-04-11 14:59:12adminsetgithub: 80363
2019-09-11 15:55:57mdksetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2019-09-11 15:55:34mdksetmessages: + msg351954
2019-09-11 15:08:21miss-islingtonsetpull_requests: + pull_request15610
2019-09-11 15:08:13mdksetnosy: + mdk
messages: + msg351923
2019-07-19 10:56:02lys.nikolaousetmessages: + msg348164
2019-03-04 13:22:15lys.nikolaousetkeywords: + patch
stage: patch review
pull_requests: + pull_request12159
2019-03-04 13:12:49lys.nikolaousetmessages: + msg337111
2019-03-04 13:07:57xtreaksetnosy: + xtreak
messages: + msg337108
2019-03-04 13:02:34methanesetnosy: + methane
messages: + msg337106
2019-03-04 12:51:47lys.nikolaousetmessages: + msg337101
2019-03-04 12:51:21lys.nikolaoucreate