issue 4804: Provide checks for the format string of strftime, and for the "mode" string of fopen on Windows. These strings are user provided from python and so we can avoid invoking the C runtime invalid parameter handler by first checking that they are valid.

This commit is contained in:
Kristján Valur Jónsson 2009-02-04 10:05:25 +00:00
parent 8bdd3b3dcf
commit fd4c872726
3 changed files with 106 additions and 2 deletions

View file

@ -154,7 +154,7 @@ class OtherFileTests(unittest.TestCase):
for name in (TESTFN, unicode(TESTFN), unicode(TESTFN + '\t')):
try:
f = open(name, "rr")
except IOError:
except (IOError, ValueError):
pass
else:
f.close()