python-openxml / python-docx

Create and modify Word documents with Python
MIT License
4.63k stars 1.13k forks source link

Documenting overwrite behaviour of Document.save #1252

Open jessexknight opened 1 year ago

jessexknight commented 1 year ago

Please consider adding to the docs that "Document.save" overwrites the .docx file by default. Could add this info here. Thanks,

scanny commented 1 year ago

I take it that means you lost some work, sorry about that.

The thing is, python-docx almost always runs unattended, so it's not like it can ask you "are you sure Y/N".

What behavior were you expecting or imagine might be better?

jessexknight commented 1 year ago

Thanks -- fortunately I didn't lose any work, and I personally find this default behaviour expected. I agree it wouldn't be reasonable to add this warning at runtime. I only mean to suggest adding a sentence on the Document.save method documentation (i.e. readthedocs page linked above).

scanny commented 1 year ago

k, sure :)