cpython: 3c9ddd93c983 (original) (raw)

Mercurial > cpython

changeset 73743:3c9ddd93c983 3.2

Issue #12856: Ensure child processes do not inherit the parent's random seed for filename generation in the tempfile module. Patch by Brian Harring. [#12856]

Antoine Pitrou solipsis@pitrou.net
date Fri, 25 Nov 2011 21:28:15 +0100
parents 2d6f0e2fe034
children 588087429809 fa59b3758b14
files Lib/tempfile.py Lib/test/test_tempfile.py Misc/NEWS
diffstat 3 files changed, 43 insertions(+), 2 deletions(-)[+] [-] Lib/tempfile.py 9 Lib/test/test_tempfile.py 32 Misc/NEWS 4

line wrap: on

line diff

--- a/Lib/tempfile.py +++ b/Lib/tempfile.py @@ -112,8 +112,13 @@ class RandomNameSequence: characters = "abcdefghijklmnopqrstuvwxyz0123456789"

def iter(self): return self

--- a/Lib/test/test_tempfile.py +++ b/Lib/test/test_tempfile.py @@ -1,6 +1,7 @@

tempfile.py unit tests.

import tempfile import os +import signal import sys import re import warnings @@ -135,6 +136,37 @@ class test__RandomNameSequence(TC): except: self.failOnException("iteration")

+ + test_classes.append(test__RandomNameSequence)

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -83,6 +83,10 @@ Core and Builtins Library ------- +- Issue #12856: Ensure child processes do not inherit the parent's random