summaryrefslogtreecommitdiffstats
path: root/Lib/mailbox.py
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Convert a pile of obvious "yes/no" functions to return bool.Tim Peters2002-04-041-1/+1
|
* Try /var/mail before trying /usr/mail. Most new systems use /var.Neil Schemenauer2002-03-241-1/+4
| | | | | This in inside the test so it really doesn't matter much. Closes SF patch 497097.
* Added PortableUnixMailbox to the __all__ variable, and in the __main__Barry Warsaw2002-03-011-2/+4
| | | | | | | section use this class instead of UnixMailbox as per the comments in the latter's class. Bug fix candidate for 2.2.1.
* SF bug #461073: mailbox __iter__ bug, by Andrew Dalke.Guido van Rossum2001-09-131-3/+3
| | | | | | | Andrew quite correctly notices that the next() method isn't quite what we need, since it returns None upon end instead of raising StopIteration. His fix is easy enough, using iter(self.next, None) instead.
* Remove redundant imports (PyChecker).Guido van Rossum2001-08-131-2/+0
|
* Make the Mailbox objects support iteration -- they already had theFred Drake2001-05-021-0/+9
| | | | | appropriate next() method, and this is what people really want to do with these objects in practice.
* Get rid of the seek() method on the _Mailbox class. This was aGuido van Rossum2001-04-151-8/+0
| | | | | | | | | | | | cut-and-paste copy of the seek() method on the _Subfile class, but it didn't make one bit of sense: it sets self.pos, which is not used in this class or its subclasses, and it uses self.start and self.stop, which aren't defined on this class or its subclasses. This is purely my own fault -- I added this in rev 1.4 and apparently never tried to use it. Since it's not documented, and of very questionable use given that there's no tell(), I'm ripping it out. This resolves SF bug 416199 by Andrew Dalke: mailbox.py seek problems.
* Two changes:Barry Warsaw2001-01-311-12/+43
| | | | | | | | | | | | - All constructors grow an optional argument `factory' which is a callable used when new message instances are created by the next() methods. Defaults to the rfc822.Message class. - A new subclass of UnixMailbox is added, called PortableUnixMailbox. It's identical to UnixMailbox, but uses a more portable test for From_ delimiter lines. With PortableUnixMailbox, any line that starts with "From " is considered a delimiter (this should really check for two newlines before the F, but it doesn't.
* a few more modules get __all__Skip Montanaro2001-01-241-0/+2
|
* Update the code to better reflect recommended style:Fred Drake2000-12-121-1/+1
| | | | | Use != instead of <> since <> is documented as "obsolescent". Use "is" and "is not" when comparing with None or type objects.
* Maildir.__init__(): Make sure self.boxes is set.Fred Drake2000-10-231-3/+3
| | | | This closes SourceForge bug #117490.
* Add missing "s" from format string.Fred Drake2000-09-301-1/+1
| | | | This closes SourceForge patch #101714.
* Maildir.__init__(): Use the correct filter for filenames, so that thisFred Drake2000-09-221-7/+4
| | | | class conforms to the maildir specification.
* Detlef Lannert <lannert@uni-duesseldorf.de>:Fred Drake2000-09-141-2/+2
| | | | | | | | | | | | | mailbox.py (from the CVS tree) doesn't work with qmail Maildirs: Filenames are completed when the directories are scanned, and the directory name is prepended again in the next() method. Another suggestion: Change the print statement in the _test() driver to show two more date characters (probably the length has increased due to the recent Y2K hype ;). Now it shows the complete date, including the seconds -- at least for me. (I've also made the sender field left justified, in case it is ever shorter than the field width).
* Use built in function filter instead of doing it laboriously by hand.Sjoerd Mullender2000-08-111-5/+4
|
* Improve MHMailbox: messages are now sorted in numerical order.Guido van Rossum2000-08-101-3/+8
| | | | Also don't allow leading zeros in message numbers.
* Make tabnanny happy.Fred Drake2000-07-091-243/+242
| | | | mailbox.py: Convert to 4-space indents.
* Since Thomas Wouters kept complaining that he wants access to the theGuido van Rossum2000-04-041-0/+3
| | | | | | | | Unix From lines, change the UnixMailbox class so that _search_start() positions the file *before* the Unix From line instead of after it; change _search_end() to skip one line before looking for the next From line. The rfc822.Message class automatically recognizes these Unix From lines and squirrels them away in the 'unixfrom' instance variable.
* Untabify to pass the -tt test.Fred Drake2000-02-101-240/+240
|
* Only set msg.fp to None when there are no extra arguments; if thereGuido van Rossum1999-12-141-1/+2
| | | | are, we must keep the file around so we can print the body.
* Add readlines() to _Subfile class. Not clear who would need it, butGuido van Rossum1999-03-241-0/+13
| | | | | Chris Lawrence sent me a broken version; this one is a tad simpler and more conforming to the standard.
* Patch by Mike Meyer:Guido van Rossum1998-12-231-4/+35
| | | | | Add a class to mailbox.py for dealing with qmail directory mailboxes. The test code was extended to notice these being used as well.
* Patch by Piet van Oostrum to avoid calculating with the result ofGuido van Rossum1998-07-201-6/+5
| | | | | | | fp.tell() -- that won't work on Windows. (A patch for rfc822 is still needed for one case where it finds a bad header line and wants to back up.)
* The _fromlinepattern was a little too restrictive -- some sendmailsGuido van Rossum1998-07-021-1/+1
| | | | don't put the seconds in the time!
* In class _Subfile, make sure read(n) can't read beyond EOF. AlsoGuido van Rossum1998-06-171-2/+5
| | | | | allow negative numbers to specify read until EOF (like for a regular file's read() method).
* UnixMailbox: don't be fooled by lines that begin with "From " butGuido van Rossum1998-04-031-6/+22
| | | | | otherwise don't look like headers at all... Also robustify the test code a bit.
* A few lines were indented using spaces instead of tabs -- fix them.Guido van Rossum1998-03-261-37/+43
|
* Convert all remaining *simple* cases of regex usage to re usage.Guido van Rossum1997-10-221-3/+4
|
* Added BabylMailbox class by Fred Lundh (untested).Guido van Rossum1997-05-151-0/+20
|
* Improve getting the mailbox from the environment.Guido van Rossum1997-05-081-5/+5
|
* /usr/local/bin/python -> /usr/bin/env pythonGuido van Rossum1996-11-271-1/+1
|
* Revamped test case and updated doc string.Guido van Rossum1996-09-171-23/+41
|
* support 'whence' arg to seek()Guido van Rossum1996-01-251-2/+7
|