From 86c67680763b9f0e4a6821fbfde99e8520853a6f Mon Sep 17 00:00:00 2001 From: bwarsaw Date: Tue, 29 Dec 1998 19:28:57 +0000 Subject: Be sure we import the latest version of tempfile.py from the Python 1.5.2 distribution, so that names are uniquely generated in fork() related children. Use a simlar import/hasattr trick as when importing the latest smtplib.py --- Mailman/OutgoingQueue.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'Mailman/OutgoingQueue.py') diff --git a/Mailman/OutgoingQueue.py b/Mailman/OutgoingQueue.py index 6435cfa56..776deffcf 100644 --- a/Mailman/OutgoingQueue.py +++ b/Mailman/OutgoingQueue.py @@ -36,9 +36,21 @@ # only one such process to happen at a time. # -import os, stat, tempfile, marshal, errno, mm_cfg +import os +import stat +import marshal +import errno +import mm_cfg import Utils +# We need the version of tempfile.py from Python 1.5.2 because it has +# provisions for uniquifying filenames in concurrent children after a fork. +# If not using Python 1.5.2's version, let's get our copy of the new file. +import tempfile +if not hasattr(tempfile, '_pid'): + from Mailman.pythonlib import tempfile +assert hasattr(tempfile, '_pid') + TEMPLATE = "mm_q." # # multiple prcesses with different uids can write and/or @@ -170,10 +182,3 @@ def deferMessage(q_entry): # def dequeueMessage(q_entry): os.unlink(q_entry) - - - - - - - -- cgit v1.2.3-70-g09d2