Message142193
Currently, opening a file with open(file, 'w') overwrites existing files. It would be useful for open() to raise an error when the file exists. This proposal is to add a 'c' mode to open, which has the effect to creating a file and opening it for writing, but raising an IOError if it already exists (i.e. the same as os.open(file, os.O_EXCL|os.O_CREAT).
The attached patch implements this, including tests and documentation. |
|
Date |
User |
Action |
Args |
2011-08-16 13:49:19 | David.Townshend | set | recipients:
+ David.Townshend, docs@python |
2011-08-16 13:49:19 | David.Townshend | set | messageid: <1313502559.06.0.415498401391.issue12760@psf.upfronthosting.co.za> |
2011-08-16 13:49:18 | David.Townshend | link | issue12760 messages |
2011-08-16 13:49:18 | David.Townshend | create | |
|