[New-bugs-announce] [issue12856] tempfile PRNG reuse between parent and child process

Ferringb report at bugs.python.org
Tue Aug 30 02:31:53 CEST 2011

New submission from Ferringb <ferringb at gmail.com>:

Roughly; tempfile's uniqueness is derived from a global random instance; while there are protections for thread access, a forked child process /will/ inherit that PRNG source, resulting in children/parent trying the same set of names.

Mostly it's proving annoying in some code I have to deal in, although it wouldn't surprise me if someone watching a known temp location could use the predictability in some fashion.

As for affect, all versions of python have this; attached patch is cut against trunk.

files: unique-seed-per-process-tempfile.patch
keywords: patch
messages: 143192
nosy: ferringb
priority: normal
severity: normal
status: open
title: tempfile PRNG reuse between parent and child process
type: behavior
Added file: http://bugs.python.org/file23066/unique-seed-per-process-tempfile.patch

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list