- Issue #2091: error correctly on open() with mode 'U' and '+'
open() accepted a 'U' mode string containing '+', but 'U' can only be used with
'r'. Patch from Jeff Balogh and John O'Connor.
diff --git a/Lib/test/test_file.py b/Lib/test/test_file.py
index d54e976..94f189a 100644
--- a/Lib/test/test_file.py
+++ b/Lib/test/test_file.py
@@ -139,7 +139,7 @@
def testModeStrings(self):
# check invalid mode strings
- for mode in ("", "aU", "wU+"):
+ for mode in ("", "aU", "wU+", "U+", "+U", "rU+"):
try:
f = self.open(TESTFN, mode)
except ValueError: