summaryrefslogtreecommitdiff
path: root/Lib/mailbox.py
Commit message (Collapse)AuthorAgeFilesLines
* #15222: Insert blank line after each message in mbox mailboxesPetri Lehtinen2012-09-251-8/+41
|
* #11062: Fix adding a message from file to Babyl mailboxPetri Lehtinen2012-08-151-1/+1
|
* #5346: Preserve permissions of mbox, MMDF and Babyl mailbox files on flush()Petri Lehtinen2012-06-291-0/+3
|
* #9559: Don't call _pre_mailbox_hook more than oncePetri Lehtinen2012-06-291-2/+5
|
* #9559: Append data to single-file mailbox files if messages are only addedPetri Lehtinen2012-06-281-3/+15
| | | | | | If messages were only added, a new file is no longer created and renamed over the old file when flush() is called on an mbox, MMDF or Babyl mailbox.
* #15036: Make a repeated changes and flushes work with single-file mailboxesPetri Lehtinen2012-06-151-0/+1
|
* Fix Maildir initialization so that maildir contents are read correctly.Petri Lehtinen2011-11-051-5/+3
| | | | Closes #13254.
* #11700: proxy object close methods can now be called multiple timesR David Murray2011-06-171-1/+10
| | | | | | This makes them work like the close provided by regular file objects. This patch also backports the close-the-underlying-file code for _ProxyFile objects that was introduced along with context manager support in the 3.x branch.
* #11999: sync based on comparing mtimes, not mtime to system clockR David Murray2011-05-061-37/+39
|
* Merged revisions 88730 via svnmerge fromR. David Murray2011-03-031-3/+3
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r88730 | r.david.murray | 2011-03-03 13:03:36 -0500 (Thu, 03 Mar 2011) | 2 lines #11306: Treat EROFS like EACCES when making a 'file is read-only' decision ........
* Merged revisions 88407 via svnmerge fromR. David Murray2011-02-121-1/+8
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r88407 | r.david.murray | 2011-02-11 19:03:31 -0500 (Fri, 11 Feb 2011) | 2 lines Fix #11116 fix on Windows (close file before removing in MH code) ........
* Merged revisions 88403 via svnmerge fromR. David Murray2011-02-111-6/+18
| | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k Test not backported since they depend on 3.x quirks. Not easy to rewrite them for 2.7. ........ r88403 | r.david.murray | 2011-02-11 17:47:17 -0500 (Fri, 11 Feb 2011) | 3 lines #11116: roll back on error during add so mailbox isn't left corrupted. ........
* Merged revisions 83385-83389,83391 via svnmerge fromGeorg Brandl2010-08-011-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r83385 | georg.brandl | 2010-08-01 08:42:45 +0200 (So, 01 Aug 2010) | 1 line #8773: mailbox.py does not need to be executable. ........ r83386 | georg.brandl | 2010-08-01 08:44:46 +0200 (So, 01 Aug 2010) | 1 line #8768: name test method properly so that it gets executed. ........ r83387 | georg.brandl | 2010-08-01 08:53:28 +0200 (So, 01 Aug 2010) | 1 line #8735: better explain semantics of *values* argument for parse(). ........ r83388 | georg.brandl | 2010-08-01 09:48:43 +0200 (So, 01 Aug 2010) | 1 line #7395: fix traceback in do_add() when no stats are loaded. Apply same fix for do_sort() and do_reverse(). ........ r83389 | georg.brandl | 2010-08-01 09:57:47 +0200 (So, 01 Aug 2010) | 1 line Small improvements to pstats browser: do not crash on reading invalid file, and actually do a reload when executing "read" as intended. ........ r83391 | georg.brandl | 2010-08-01 10:10:08 +0200 (So, 01 Aug 2010) | 1 line Add another news entry. ........
* #7627: MH.remove() would fail if the MH mailbox was locked;Andrew M. Kuchling2010-02-221-10/+2
| | | | it would call _unlock_file() and pass it a closed file object. Noted by Rob Austein.
* Issue #7092: Fix the DeprecationWarnings emitted by the standard libraryAntoine Pitrou2010-01-041-1/+7
| | | | when using the -3 flag. Patch by Florent Xicluna.
* This should finally fix #6896. Let's watch the buildbots.Antoine Pitrou2009-11-011-1/+12
|
* Hopefully fix the buildbot problems on test_mailbox, by computingAntoine Pitrou2009-11-011-13/+15
| | | | | | the maildir toc cache refresh date before actually refreshing the cache. (see #6896)
* #1607951: Make mailbox.Maildir re-read the directories less frequently.Andrew M. Kuchling2009-05-021-4/+24
| | | | | This is done by recording the current time -1sec, and not re-reading unless the directory mod. times are >= the recorded time.
* Add missing iteritems() call to the for loop in mailbox.MH.get_message().R. David Murray2009-04-021-1/+1
| | | | Fixes issue2625.
* Bug 3228: Explicitly supply the file mode to avoid creating executable files,Andrew M. Kuchling2008-08-041-2/+3
| | | | | and add corresponding tests. Possible 2.5 backport candidate
* Bug 1277: make Maildir use the user-provided factory instead of hard-wiring ↵Andrew M. Kuchling2008-01-191-1/+4
| | | | | | MaildirMessage. 2.5.2 bugfix candidate.
* Avoid exception if there's a stray directory inside a Maildir folder.Andrew M. Kuchling2007-07-141-1/+5
| | | | | | | The Maildir specification doesn't seem to say anything about this situation, and it can happen if you're keeping a Maildir mailbox in Subversion (.svn directories) or some similar system. The patch just ignores directories in the cur/, new/, tmp/ folders.
* Whitespace normalization.Tim Peters2007-01-301-3/+3
|
* Make comment match the codeAndrew M. Kuchling2007-01-221-1/+1
|
* Improve pattern used for mbox 'From' lines; add a simple testAndrew M. Kuchling2007-01-221-2/+4
|
* Use new email module names (#1637162, #1637159, #1637157).Georg Brandl2007-01-221-12/+12
|
* [Apply length-checking.diff from bug #1599254]Andrew M. Kuchling2006-12-201-2/+23
| | | | | | | | | | | | | | | | | Add length checking to single-file mailbox formats: before doing a flush() on a mailbox, seek to the end and verify its length is unchanged, raising ExternalClashError if the file's length has changed. This fix avoids potential data loss if some other process appends to the mailbox file after the table of contents has been generated; instead of overwriting the modified file, you'll get the exception. I also noticed that the self._lookup() call in self.flush() wasn't necessary (everything that sets self._pending to True also calls self.lookup()), and replaced it by an assertion. 2.5 backport candidate.
* [Patch #1599256 from David Watson] check that os.fsync is available before ↵Andrew M. Kuchling2006-12-141-1/+2
| | | | using it
* Remove file-locking in MH.pack() method.Andrew M. Kuchling2006-11-171-21/+7
| | | | | | | | | | | | | | | | | | This change looks massive but it's mostly a re-indenting after removing some try...finally blocks. Also adds a test case that does a pack() while the mailbox is locked; this test would have turned up bugs in the original code on some platforms. In both nmh and GNU Mailutils' implementation of MH-format mailboxes, no locking is done of individual message files when renaming them. The original mailbox.py code did do locking, which meant that message files had to be opened. This code was buggy on certain platforms (found through reading the code); there were code paths that closed the file object and then called _unlock_file() on it. Will backport to 25-maint once I see how the buildbots react to this patch.
* [Patch #1514543] mailbox (Maildir): avoid losing messages on name clashAndrew M. Kuchling2006-11-091-5/+22
| | | | | | | | | | | Two changes: Where possible, use link()/remove() to move files into a directory; this makes it easier to avoid overwriting an existing file. Use _create_carefully() to create files in tmp/, which uses O_EXCL. Backport candidate.
* [Patch #1514544 by David Watson] use fsync() to ensure data is really on diskAndrew M. Kuchling2006-11-091-7/+23
|
* [Bug #1569790] mailbox.Maildir.get_folder() loses factory informationAndrew M. Kuchling2006-11-091-4/+8
| | | | | | | Both the Maildir and MH classes had this bug; the patch fixes both classes and adds a test. Will backport to 25-maint.
* [Bug #1575506] The _singlefileMailbox class was using the wrong file object ↵Andrew M. Kuchling2006-10-271-1/+1
| | | | in its flush() method, causing an error
* Get mailbox module working on OS/2 EMX port.Andrew MacIntyre2006-07-231-2/+10
|
* According to the man pages on Gentoo Linux and Tru64, EACCES or EAGAINNeal Norwitz2006-06-281-1/+1
| | | | | can be returned if fcntl (lockf) fails. This fixes the test failure on Tru64 by checking for either error rather than just EAGAIN.
* [Bug #1512163] Use one set of locking methods, lockf();Andrew M. Kuchling2006-06-261-12/+2
| | | | | | | | | remove the flock() calls. On FreeBSD, the two methods lockf() and flock() end up using the same mechanism and the second one fails. A Linux man page claims that the two methods are orthogonal (so locks acquired one way don't interact with locks acquired the other way) but that clearly must be false.
* [Bug #1512163] Fix typo.Andrew M. Kuchling2006-06-261-1/+1
| | | | | This change will probably break tests on FreeBSD buildbots, but I'll check in a fix for that next.
* Change WindowsError to carry the Win32 error code in winerror,Martin v. Löwis2006-05-111-28/+0
| | | | | and the DOS error code in errno. Revert changes where WindowsError catch blocks unnecessarily special-case OSError.
* Update checks to consider Windows error numbers.Martin v. Löwis2006-05-041-3/+29
|
* Use open() instead of file()Andrew M. Kuchling2006-05-021-20/+20
|
* Whitespace normalization.Tim Peters2006-04-221-3/+3
|
* Add Gregory K. Johnson's revised version of mailbox.py (funded byAndrew M. Kuchling2006-04-221-145/+1892
| | | | | | | | | | | | | | | | | the 2005 Summer of Code). The revision adds a number of new mailbox classes that support adding and removing messages; these classes also support mailbox locking and default to using email.Message instead of rfc822.Message. The old mailbox classes are largely left alone for backward compatibility. The exception is the Maildir class, which was present in the old module and now inherits from the new classes. The Maildir class's interface is pretty simple, though, so I think it'll be compatible with existing code. (The change to the NEWS file also adds a missing word to a different news item, which unfortunately required rewrapping the line.)
* Patch #880621: the last message of a Babyl mailbox ends in '\037' instead ofJohannes Gijsbers2004-08-211-1/+1
| | | | | '\037\014\n' (see http://quimby.gnus.org/notes/BABYL) so look for that as well, so that applications won't get '\037' as the last line of the last message.
* add missing newlines to read/readline.Skip Montanaro2004-07-241-2/+2
| | | | fixes bug #996359.
* [Bug #925107] Make .readline() consider self.stop. This makes read() and ↵Andrew M. Kuchling2004-07-071-13/+8
| | | | | | readline() very similar, so they're refactored into _read. Patch by Johannes Gijsbers. 2.3 bugfix candidate.
* Lists work better when popping from the right.Raymond Hettinger2004-02-071-3/+4
|
* Undocumented feature: MHMailbox sets the msg object's _mh_msgnoGuido van Rossum2002-09-121-1/+12
| | | | | | | | attribute to the (stringized) message number (if this attribute is settable). This is useful so users of this class can report the correct message number (e.g. when classifying spam). Also added a blank line before the first method of each class.
* Fix an inaccuracy in the commentBarry Warsaw2002-08-261-2/+2
|
* Code modernization. Replace v=s[i]; del s[i] with single lookup v=s.pop(i)Raymond Hettinger2002-06-301-4/+2
|
* SF 563203. Replaced 'has_key()' with 'in'.Raymond Hettinger2002-06-011-1/+1
|