New submission from David Townshend <aquavita...@gmail.com>: 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. ---------- assignee: docs@python components: Documentation, IO, Library (Lib), Tests files: open_create.patch keywords: patch messages: 142193 nosy: David.Townshend, docs@python priority: normal severity: normal status: open title: Add create mode to open() type: feature request versions: Python 3.3 Added file: http://bugs.python.org/file22910/open_create.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue12760> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com