summaryrefslogtreecommitdiffstats
path: root/Lib/tempfile.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-08-13 23:28:28 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2013-08-13 23:28:28 (GMT)
commit97869103ba09fb6a468312d303193902ff13160a (patch)
treefbb1a98f601ddc3eed85f2a0bd01f0e0ea884903 /Lib/tempfile.py
parent0c7907dd48968d492f50b774239954a6af1302d5 (diff)
downloadcpython-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/tempfile.py')
-rw-r--r--Lib/tempfile.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/tempfile.py b/Lib/tempfile.py
index 10b6a1b..7df881b 100644
--- a/Lib/tempfile.py
+++ b/Lib/tempfile.py
@@ -125,7 +125,7 @@ class _RandomNameSequence:
def __next__(self):
c = self.characters
choose = self.rng.choice
- letters = [choose(c) for dummy in "123456"]
+ letters = [choose(c) for dummy in range(8)]
return ''.join(letters)
def _candidate_tempdir_list():