diff options
| author | bwarsaw | 1998-12-29 19:28:57 +0000 |
|---|---|---|
| committer | bwarsaw | 1998-12-29 19:28:57 +0000 |
| commit | 86c67680763b9f0e4a6821fbfde99e8520853a6f (patch) | |
| tree | 345ce7e623fc71bf4c5645c7f7e361adf004c17f /Mailman/OutgoingQueue.py | |
| parent | b8e8bdff06412c8282f0360d26fd5667a1a851d3 (diff) | |
| download | mailman-86c67680763b9f0e4a6821fbfde99e8520853a6f.tar.gz mailman-86c67680763b9f0e4a6821fbfde99e8520853a6f.tar.zst mailman-86c67680763b9f0e4a6821fbfde99e8520853a6f.zip | |
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
Diffstat (limited to 'Mailman/OutgoingQueue.py')
| -rw-r--r-- | Mailman/OutgoingQueue.py | 21 |
1 files changed, 13 insertions, 8 deletions
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) - - - - - - - |
