[New-bugs-announce] [issue4829] confusing error for file("foo", "w++")

Ulrich Eckhardt report at bugs.python.org
Sun Jan 4 12:17:18 CET 2009

New submission from Ulrich Eckhardt <eckhardt at satorlaser.com>:

Specifying the '+' more than once while opening a file results in the
error "Must have exactly one of read/write/append mode". The attached
patch extends that with ".. and at most one optional plus".

Further, the patch checks these after the loop that parses the mode
string, avoiding some unnecessary gotos and saving a few lines of code

components: Interpreter Core
files: python-2.7-fopen-mode-parsing.0.patch
keywords: patch
messages: 79043
nosy: eckhardt
severity: normal
status: open
title: confusing error for file("foo", "w++")
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file12581/python-2.7-fopen-mode-parsing.0.patch

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list