[New-bugs-announce] [issue43133] Accept file mode "rw" to open-or-create a file and seek to the start
Nick Coghlan
report at bugs.python.org
Thu Feb 4 23:36:25 EST 2021
New submission from Nick Coghlan <ncoghlan at gmail.com>:
After yet again trying to use "rw" to open a file in read/write mode, having it fail, and then having to look up the docs to remind myself that the correct spelling is "r+", I'm finally filing this to suggest we make the obvious "rw" spelling actually work.
Rather than making it an alias for any of the existing modes, I'd suggest that it combine the features of "r+" and "a+":
* like "r+" it would start the file pointer at the beginning of the file
* like "a+" it would create the file if it didn't exist, while leaving existing files alone
----------
messages: 386510
nosy: ncoghlan
priority: low
severity: normal
status: open
title: Accept file mode "rw" to open-or-create a file and seek to the start
type: enhancement
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43133>
_______________________________________
More information about the New-bugs-announce
mailing list