Issue 1461783: Invalid modes crash open() (original) (raw)
The 2.5a0 interpreter can be crashed by opening a file with an invalid mode, i.e
open("bogus", "bogus")
results in the Microsoft Visual C++ Debug Library spewing an "assertion failed" message with the expression
("Invalid file open mode", 0)
in the file _open.c, line 98.
Attached is a very rough patch that raises and IOError if the open mode doesn't begin with an 'a', 'w' or 'r' on the Windows platform.
If this is something wrong at my end (and I feel it may be) please let me know. I'd be happy to offer any more information.
BTW, I'm using Microsoft Visual Studio 2005.
Thanks, Matt