diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-08-13 23:28:28 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-08-13 23:28:28 (GMT) |
commit | 97869103ba09fb6a468312d303193902ff13160a (patch) | |
tree | fbb1a98f601ddc3eed85f2a0bd01f0e0ea884903 /Lib/test/test_tempfile.py | |
parent | 0c7907dd48968d492f50b774239954a6af1302d5 (diff) | |
download | cpython-97869103ba09fb6a468312d303193902ff13160a.zip cpython-97869103ba09fb6a468312d303193902ff13160a.tar.gz cpython-97869103ba09fb6a468312d303193902ff13160a.tar.bz2 |
Close #12015: The tempfile module now uses a suffix of 8 random characters
instead of 6, to reduce the risk of filename collision. The entropy was reduced
when uppercase letters were removed from the charset used to generate random
characters.
Diffstat (limited to 'Lib/test/test_tempfile.py')
-rw-r--r-- | Lib/test/test_tempfile.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_tempfile.py b/Lib/test/test_tempfile.py index 437b02b..6b146d2 100644 --- a/Lib/test/test_tempfile.py +++ b/Lib/test/test_tempfile.py @@ -35,7 +35,7 @@ else: # Common functionality. class BaseTestCase(unittest.TestCase): - str_check = re.compile(r"[a-zA-Z0-9_-]{6}$") + str_check = re.compile(r"^[a-z0-9_-]{8}$") def setUp(self): self._warnings_manager = support.check_warnings() @@ -62,7 +62,7 @@ class BaseTestCase(unittest.TestCase): nbase = nbase[len(pre):len(nbase)-len(suf)] self.assertTrue(self.str_check.match(nbase), - "random string '%s' does not match /^[a-zA-Z0-9_-]{6}$/" + "random string '%s' does not match ^[a-z0-9_-]{8}$" % nbase) |