[ python-Bugs-857566 ] tempfile.mktemp() omits pid from name

SourceForge.net noreply at sourceforge.net
Wed Dec 10 08:53:44 EST 2003


Bugs item #857566, was opened at 2003-12-10 13:53
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=857566&group_id=5470

Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Gottfried Ganßauge (ganssauge)
Assigned to: Nobody/Anonymous (nobody)
Summary: tempfile.mktemp() omits pid from name

Initial Comment:
In python2.2 names created using tempfile.mktemp() 
contained the current pid as a prefix.
This behaviour has changed and now processes running 
concurrently are prone to races.
1.) In my application which forks a few thousand sub 
processes over time sometimes tempfiles created by one 
subprocess are deleted by another.
2.) Also this probably leads to longer creation times 
when two processes want to create a temp file at the 
same time on multiprocessor machines because both 
processes are using the same rng with the same seed to 
generate names.
Sorry, no code here, because 1. happens only a few 
times when running with huge amounts of data and 
because 2. is only a speculation.

I would propose to reinstate the former behaviour.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=857566&group_id=5470



More information about the Python-bugs-list mailing list