Skip to content
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

pathlib: Add exist_ok argument to write_text and write_bytes #17688

Open
wants to merge 1 commit into
base: master
from

Conversation

@cool-RR
Copy link
Contributor

cool-RR commented Dec 23, 2019

Hi guys,

What do you think about adding an exist_ok argument to write_text and write_bytes?

If you think it could be useful, I'll add everything that's missing from this PR. (Tests, documentation, news entry, bpo issue.)

Usual suspects: @brandtbucher @taleinat @pitrou

@Penlect

This comment has been minimized.

Copy link
Contributor

Penlect commented Dec 24, 2019

I'm not a core developer, but IMHO it feels like the write-methods here are intentionally designed to be simple like so. If you need any more options, the builtin open function does exactly that. Suppose the exist_ok option is added, why stop there? Why not also add an option do_append (mode='a'), etc. I think the buildin-open is better in these cases. Just my immediate thought, have a nice day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.