diff options
| author | bwarsaw | 2007-01-05 06:47:39 +0000 |
|---|---|---|
| committer | bwarsaw | 2007-01-05 06:47:39 +0000 |
| commit | 9af2533eb89e48683c049c5007737f7e94bbcdc1 (patch) | |
| tree | 54853dcccee453eae60916af4e612b3004cc736f /Mailman/Pending.py | |
| parent | d7da90ebc8aeee180ba470c002f7e37ef7df1089 (diff) | |
| download | mailman-9af2533eb89e48683c049c5007737f7e94bbcdc1.tar.gz mailman-9af2533eb89e48683c049c5007737f7e94bbcdc1.tar.zst mailman-9af2533eb89e48683c049c5007737f7e94bbcdc1.zip | |
Diffstat (limited to 'Mailman/Pending.py')
| -rw-r--r-- | Mailman/Pending.py | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/Mailman/Pending.py b/Mailman/Pending.py index eb3b7950e..f5794453d 100644 --- a/Mailman/Pending.py +++ b/Mailman/Pending.py @@ -1,4 +1,4 @@ -# Copyright (C) 1998-2006 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2007 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -113,18 +113,14 @@ class Pending: del evictions[cookie] db['version'] = config.PENDING_FILE_SCHEMA_VERSION tmpfile = '%s.tmp.%d.%d' % (self.__pendfile, os.getpid(), now) - omask = os.umask(007) + fp = open(tmpfile, 'w') try: - fp = open(tmpfile, 'w') - try: - cPickle.dump(db, fp) - fp.flush() - os.fsync(fp.fileno()) - finally: - fp.close() - os.rename(tmpfile, self.__pendfile) + cPickle.dump(db, fp) + fp.flush() + os.fsync(fp.fileno()) finally: - os.umask(omask) + fp.close() + os.rename(tmpfile, self.__pendfile) def pend_confirm(self, cookie, expunge=True): """Return data for cookie, or None if not found. |
