File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 5757if hasattr (_os , 'O_BINARY' ):
5858 _bin_openflags |= _os .O_BINARY
5959
60+ # This is more than enough.
61+ # Each name contains more than 40 random bits. Even with a million of
62+ # temporary files, a chance of conflict is less than 1 per million,
63+ # and with 20 attempts it is less than 1e-120.
64+ # Each name contains over 40 random bits. Even with a million temporary
65+ # files, the chance of a conflict is less than 1 in a million, and with
66+ # 20 attempts, it is less than 1e-120.
6067TMP_MAX = 20
6168
6269# This variable _was_ unused for legacy reasons, see issue 10354.
@@ -193,8 +200,7 @@ def _get_default_tempdir(dirlist=None):
193200 for dir in dirlist :
194201 if dir != _os .curdir :
195202 dir = _os .path .abspath (dir )
196- # Try only a few names per directory.
197- for seq in range (100 ):
203+ for seq in range (TMP_MAX ):
198204 name = next (namer )
199205 filename = _os .path .join (dir , name )
200206 try :
You can’t perform that action at this time.
0 commit comments