Commit Graph

102 Commits

Author SHA1 Message Date
Serhiy Storchaka 43767638a9 Issue #18702: All skipped tests now reported as skipped. 2013-11-03 21:31:38 +02:00
R David Murray a6e902ae35 Merge: #17064: fix sporadic permission errors in test_mailbox on windows.
Patch by Jeremy Kloth.
2013-02-11 10:05:34 -05:00
R David Murray 0b61d3c0f2 Merge: #17064: fix sporadic permission errors in test_mailbox on windows.
Patch by Jeremy Kloth.
2013-02-11 10:05:03 -05:00
R David Murray b3e8384cbe #17064: fix sporadic permission errors in test_mailbox on windows.
Patch by Jeremy Kloth.
2013-02-11 10:04:26 -05:00
Jesus Cea f01d695ccd Closes #16135: Removal of OS/2 support 2012-10-05 03:36:11 +02:00
Petri Lehtinen f6b30385cc #15222: Merge 3.2 2012-09-25 22:06:07 +03:00
Petri Lehtinen f39884bb5a #15222: Insert blank line after each message in mbox mailboxes 2012-09-25 22:02:06 +03:00
Petri Lehtinen 468091954f #15222: test_mailbox: End message template in a newline 2012-09-25 21:58:51 +03:00
Petri Lehtinen 6f858a2eea #15802: Fix test logic in TestMaildir.test_create_tmp 2012-09-01 14:27:24 +03:00
Petri Lehtinen 1c371b255f #15802: Fix test logic in TestMaildir.test_create_tmp 2012-09-01 14:22:36 +03:00
Petri Lehtinen aae61b8cd0 #11062: Fix adding a message from file to Babyl mailbox 2012-08-15 14:36:14 +03:00
Petri Lehtinen 3d12c4317c #11062: Fix adding a message from file to Babyl mailbox 2012-08-15 14:26:27 +03:00
Petri Lehtinen 25652884b4 #5346: Preserve permissions of mbox, MMDF and Babyl mailbox files on flush() 2012-06-29 15:12:54 +03:00
Petri Lehtinen 5b5619f717 #5346: Preserve permissions of mbox, MMDF and Babyl mailbox files on flush() 2012-06-29 15:10:41 +03:00
Petri Lehtinen dde8cb0899 #9559: Append data to single-file mailbox files if messages are only added
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.
2012-06-28 13:56:14 +03:00
Petri Lehtinen f29435f9f0 #9559: Append data to single-file mailbox files if messages are only added
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.
2012-06-28 13:53:23 +03:00
Petri Lehtinen a717d563d0 #15036: Make a repeated changes and flushes work with single-file mailboxes 2012-06-15 21:01:56 +03:00
Petri Lehtinen 02653f1b11 #15036: Make a repeated changes and flushes work with single-file mailboxes 2012-06-15 20:59:31 +03:00
R David Murray b019ee752a #12537: in mailbox avoid depending on knowledge of email package internals
Previously mailbox was copying a list of attributes from one message object to
another in order to "copy the message data".  This means that any time new
attributes were added to email.message.Message, mailbox broke.  Now instead it
copies all attributes from the source object to the target object, skipping
any mailbox-object-specific attributes to produce the same clean initial
state it was previously getting by copying only the "known" attributes.

David Lam assisted in the development of this patch.
2012-04-08 22:36:07 -04:00
R David Murray c988e24240 Remove redundancy in listing of all mailbox classes in test_mailbox. 2012-04-08 21:00:27 -04:00
R David Murray f998810deb Merge: Make test_mailbox runnable via python -m unittest. 2012-04-08 18:35:35 -04:00
R David Murray 317c8d257e Make test_mailbox runnable via python -m unittest. 2012-04-08 16:46:18 -04:00
R David Murray e2922835b0 Merge #14291: if a header has non-ascii unicode, default to CTE using utf-8
In Python2, if a unicode string was assigned as the value of a header,
email would automatically CTE encode it using the UTF8 charset.
This capability was lost in the Python3 translation, and this patch
restores it.

Patch by Ali Ikinci, assisted by R. David Murray.

I also added a fix for the mailbox test that was depending (with a comment
that it was a bad idea to so depend) on non-ASCII causing message_from_string
to raise an error.  It now uses support.patch to induce an error during
message serialization.
2012-03-14 03:03:27 -04:00
R David Murray 7441a7aedd #14291: if a header has non-ascii unicode, default to CTE using utf-8
In Python2, if a unicode string was assigned as the value of a header,
email would automatically CTE encode it using the UTF8 charset.
This capability was lost in the Python3 translation, and this patch
restores it.

Patch by Ali Ikinci, assisted by R. David Murray.

I also added a fix for the mailbox test that was depending (with a comment
that it was a bad idea to so depend) on non-ASCII causing message_from_string
to raise an error.  It now uses support.patch to induce an error during
message serialization.
2012-03-14 02:59:51 -04:00
Vinay Sajip 2f24d98df0 Closes #14158: merged test file resilience fix from 3.2. 2012-03-02 01:24:13 +00:00
Vinay Sajip f959618142 Closes #14158: improved resilience to test files left behind. 2012-03-02 01:01:13 +00:00
Charles-François Natali bf38315446 Followup to issue #11867: Use socketpair(), since FreeBSD < 8 doesn't really
support multiprocessing.Event.
2011-12-20 11:48:22 +01:00
Charles-François Natali 78ed83da46 Issue #11867: Make test_mailbox.test_lock_conflict deterministic (and fix a
race condition).
2011-12-19 12:18:55 +01:00
Charles-François Natali 29b15d11bb Followup to issue #11867: Use socketpair(), since FreeBSD < 8 doesn't really
support multiprocessing.Event.
2011-12-20 11:49:25 +01:00
Charles-François Natali bfaa79a982 Issue #11867: Make test_mailbox.test_lock_conflict deterministic (and fix a
race condition).
2011-12-19 12:19:52 +01:00
Petri Lehtinen 516d80530b Merge branch 3.2 2011-11-12 21:15:24 +02:00
Petri Lehtinen c153cd3d5a Update mailbox.Maildir tests
Remove a sleep to fix transient test failures. Use skewfactor of -3 to
make it work on systems that have 1 second precision for time.time().

Closes #11999
Refs #13254
2011-11-12 21:14:53 +02:00
Petri Lehtinen 8c481b6212 Fix Maildir initialization so that maildir contents are read correctly.
Closes #13254.
2011-11-05 09:46:10 +02:00
Petri Lehtinen 8c482ee955 Fix Maildir initialization so that maildir contents are read correctly.
Closes #13254.
2011-11-05 09:44:59 +02:00
Victor Stinner bf816223df Issue #12451: Add support.create_empty_file()
We don't need to create a temporary buffered binary or text file object just to
create an empty file.

Replace also os.fdopen(handle).close() by os.close(handle).
2011-06-30 23:25:47 +02:00
R David Murray 953510560f merge #11700: proxy object close methods can now be called multiple times 2011-06-17 22:25:14 -04:00
R David Murray c88bce1580 #11700: proxy object close methods can now be called multiple times
This makes them work like the close provided by regular file objects.
2011-06-17 22:24:05 -04:00
R David Murray 4c7d21e2b3 merge #11767: use context manager to close file in __getitem__ to prevent FD leak 2011-06-17 12:56:41 -04:00
R David Murray 05ff990401 #11767: use context manager to close file in __getitem__ to prevent FD leak
All of the other methods in mailbox that create message objects take care to
close the file descriptors they use, so it seems to make sense to have
__getitem__ do so as well.

Patch by Filip Gruszczyński.
2011-06-17 12:54:56 -04:00
R David Murray 46070ebddf #11999: sync based on comparing mtimes, not mtime to system clock 2011-05-06 22:26:27 -04:00
R David Murray 94b8ee3bff #11999: sync based on comparing mtimes, not mtime to system clock 2011-05-06 22:20:34 -04:00
R David Murray caed7fe0ff #11999: sync based on comparing mtimes, not mtime to system clock 2011-05-06 22:07:19 -04:00
R David Murray 79fe2a3462 Merge #9557: eliminate 3 seconds of static overhead from test_mailbox. 2011-03-25 16:20:16 -04:00
R David Murray 66a4e12da4 Merge #9557: eliminate 3 seconds of static overhead from test_mailbox. 2011-03-25 16:16:54 -04:00
R David Murray b9a428d57d #9557: eliminate 3 seconds of static overhead from test_mailbox.
This patch doesn't quite fix the 'run in a VM with Samba share'
timing problem, but it should at least make it better.
2011-03-25 16:03:47 -04:00
Marc-André Lemburg 8f36af7a4c Normalize the encoding names for Latin-1 and UTF-8 to
'latin-1' and 'utf-8'.

These are optimized in the Python Unicode implementation
to result in more direct processing, bypassing the codec
registry.

Also see issue11303.
2011-02-25 15:42:01 +00:00
R. David Murray fc14114ca9 #11116: roll back on error during add so mailbox isn't left corrupted. 2011-02-11 22:47:17 +00:00
R. David Murray b7deff1ddc #9124: mailbox now accepts binary input and uses binary internally
Although this patch contains API changes and is rather weighty for an
RC phase, the mailbox module was essentially unusable without the patch
since it would produce UnicodeErrors when handling non-ascii input
at arbitrary and somewhat mysterious places, and any non-trivial amount
of email processing will encounter messages with non-ascii bytes.
The release manager approved the patch application.

The changes allow binary input, and reject non-ASCII string input early
with a useful message instead of failing mysteriously later.  Binary
is used internally for reading and writing the mailbox files.  StringIO
and Text file input are deprecated.

Initial patch by Victor Stinner, validated and expanded by R. David Murray.
2011-01-30 06:21:28 +00:00
Brett Cannon 653238a88d Silence some ResourceWarning in test_mailbox by using file context managers.
Also call super().tearDown() where appropriate.
2010-10-30 00:13:00 +00:00
Brian Curtin 5acec04db5 Implement #7944. Use `with` throughout the test suite. 2010-10-13 02:29:46 +00:00