mirror of
https://github.com/python/cpython.git
synced 2025-08-01 07:33:08 +00:00
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:
parent
8bdd3b3dcf
commit
fd4c872726
3 changed files with 106 additions and 2 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue