Bug #1462152: file() now checks more thoroughly for invalid mode
strings and removes a possible "U" before passing the mode to the
C library function.
diff --git a/Lib/test/test_file.py b/Lib/test/test_file.py
index a9f5e46..53f9953 100644
--- a/Lib/test/test_file.py
+++ b/Lib/test/test_file.py
@@ -136,7 +136,7 @@
 bad_mode = "qwerty"
 try:
     open(TESTFN, bad_mode)
-except IOError, msg:
+except ValueError, msg:
     if msg[0] != 0:
         s = str(msg)
         if s.find(TESTFN) != -1 or s.find(bad_mode) == -1: