diff options
| author | Barry Warsaw | 2008-01-24 02:40:41 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2008-01-24 02:40:41 -0500 |
| commit | a76cbbcac84319245a0afb4a4dee32d4d4c79622 (patch) | |
| tree | 79be6b5955dffd2a78baa01fa53f516e35f47d2e /Mailman/rules | |
| parent | f03c31acb800d79c606ee3e206868aef8a08bfda (diff) | |
| download | mailman-a76cbbcac84319245a0afb4a4dee32d4d4c79622.tar.gz mailman-a76cbbcac84319245a0afb4a4dee32d4d4c79622.tar.zst mailman-a76cbbcac84319245a0afb4a4dee32d4d4c79622.zip | |
Python 2.5's email package uses cStringIO in its feed parser, and this doesn't
support unicode. Although this never bit me on OS X (Leopard) it matters
greatly on Linux (Ubuntu) where you get lots of test failures because of it.
So instead, just use 8-bit string in message_from_string(). Everything works
fine still.
Diffstat (limited to 'Mailman/rules')
| -rw-r--r-- | Mailman/rules/docs/administrivia.txt | 12 | ||||
| -rw-r--r-- | Mailman/rules/docs/approve.txt | 22 | ||||
| -rw-r--r-- | Mailman/rules/docs/implicit-dest.txt | 2 | ||||
| -rw-r--r-- | Mailman/rules/docs/loop.txt | 4 | ||||
| -rw-r--r-- | Mailman/rules/docs/max-size.txt | 2 | ||||
| -rw-r--r-- | Mailman/rules/docs/moderation.txt | 4 | ||||
| -rw-r--r-- | Mailman/rules/docs/news-moderation.txt | 2 | ||||
| -rw-r--r-- | Mailman/rules/docs/no-subject.txt | 2 | ||||
| -rw-r--r-- | Mailman/rules/docs/recipients.txt | 2 | ||||
| -rw-r--r-- | Mailman/rules/docs/suspicious.txt | 4 |
10 files changed, 28 insertions, 28 deletions
diff --git a/Mailman/rules/docs/administrivia.txt b/Mailman/rules/docs/administrivia.txt index de802fa85..dc9464703 100644 --- a/Mailman/rules/docs/administrivia.txt +++ b/Mailman/rules/docs/administrivia.txt @@ -16,7 +16,7 @@ used to catch messages posted to the list which should have been sent to the For example, if the Subject header contains the word 'unsubscribe', the rule matches. - >>> msg_1 = message_from_string(u"""\ + >>> msg_1 = message_from_string("""\ ... From: aperson@example.com ... Subject: unsubscribe ... @@ -27,7 +27,7 @@ matches. Similarly, if the body of the message contains the word 'subscribe' in the first few lines of text, the rule matches. - >>> msg_2 = message_from_string(u"""\ + >>> msg_2 = message_from_string("""\ ... From: aperson@example.com ... Subject: I wish to join your list ... @@ -51,7 +51,7 @@ requires at least one argument. We don't give that here so the rule will not match. >>> mlist.administrivia = True - >>> msg = message_from_string(u"""\ + >>> msg = message_from_string("""\ ... From: aperson@example.com ... Subject: confirm ... @@ -61,7 +61,7 @@ match. But a real 'confirm' message will match. - >>> msg = message_from_string(u"""\ + >>> msg = message_from_string("""\ ... From: aperson@example.com ... Subject: confirm 12345 ... @@ -77,7 +77,7 @@ Non-administrivia Of course, messages that don't contain administrivia, don't match the rule. - >>> msg = message_from_string(u"""\ + >>> msg = message_from_string("""\ ... From: aperson@example.com ... Subject: examine ... @@ -89,7 +89,7 @@ Of course, messages that don't contain administrivia, don't match the rule. Also, only text/plain parts are checked for administrivia, so any email commands in other content type subparts are ignored. - >>> msg = message_from_string(u"""\ + >>> msg = message_from_string("""\ ... From: aperson@example.com ... Subject: some administrivia ... Content-Type: text/x-special diff --git a/Mailman/rules/docs/approve.txt b/Mailman/rules/docs/approve.txt index 32367a76b..f942e351a 100644 --- a/Mailman/rules/docs/approve.txt +++ b/Mailman/rules/docs/approve.txt @@ -31,7 +31,7 @@ No approval If the message has no Approve or Approved header, then the rule does not match. - >>> msg = message_from_string(u"""\ + >>> msg = message_from_string("""\ ... From: aperson@example.com ... ... An important message. @@ -89,7 +89,7 @@ using a 'pseudo-header', which is really just the first non-whitespace line in the payload of the message. If this pseudo-header looks like a matching Approve or Approved header, the message is similarly allowed to pass. - >>> msg = message_from_string(u"""\ + >>> msg = message_from_string("""\ ... From: aperson@example.com ... ... Approve: abcxyz @@ -111,7 +111,7 @@ The pseudo-header is removed. Similarly for the Approved header. - >>> msg = message_from_string(u"""\ + >>> msg = message_from_string("""\ ... From: aperson@example.com ... ... Approved: abcxyz @@ -132,7 +132,7 @@ Similarly for the Approved header. As before, a mismatch in the pseudo-header does not approve the message, but the pseudo-header line is still removed. - >>> msg = message_from_string(u"""\ + >>> msg = message_from_string("""\ ... From: aperson@example.com ... ... Approve: 123456 @@ -152,7 +152,7 @@ the pseudo-header line is still removed. Similarly for the Approved header. - >>> msg = message_from_string(u"""\ + >>> msg = message_from_string("""\ ... From: aperson@example.com ... ... Approved: 123456 @@ -178,7 +178,7 @@ Mailman searches for the pseudo-header as the first non-whitespace line in the first text/plain message part of the message. This allows the feature to be used with MIME documents. - >>> msg = message_from_string(u"""\ + >>> msg = message_from_string("""\ ... From: aperson@example.com ... MIME-Version: 1.0 ... Content-Type: multipart/mixed; boundary="AAA" @@ -223,7 +223,7 @@ Like before, the pseudo-header is removed, but only from the text parts. The same goes for the Approved message. - >>> msg = message_from_string(u"""\ + >>> msg = message_from_string("""\ ... From: aperson@example.com ... MIME-Version: 1.0 ... Content-Type: multipart/mixed; boundary="AAA" @@ -268,7 +268,7 @@ And the header is removed. Here, the correct password is in the non-text/plain part, so it is ignored. - >>> msg = message_from_string(u"""\ + >>> msg = message_from_string("""\ ... From: aperson@example.com ... MIME-Version: 1.0 ... Content-Type: multipart/mixed; boundary="AAA" @@ -312,7 +312,7 @@ And yet the pseudo-header is still stripped. As before, the same goes for the Approved header. - >>> msg = message_from_string(u"""\ + >>> msg = message_from_string("""\ ... From: aperson@example.com ... MIME-Version: 1.0 ... Content-Type: multipart/mixed; boundary="AAA" @@ -362,7 +362,7 @@ Because some mail readers will include both a text/plain part and a text/html alternative, the 'approved' rule has to search the alternatives and strip anything that looks like an Approve or Approved headers. - >>> msg = message_from_string(u"""\ + >>> msg = message_from_string("""\ ... From: aperson@example.com ... MIME-Version: 1.0 ... Content-Type: multipart/mixed; boundary="AAA" @@ -419,7 +419,7 @@ And the header-like text in the text/html part was stripped. This is true even if the rule does not match. - >>> msg = message_from_string(u"""\ + >>> msg = message_from_string("""\ ... From: aperson@example.com ... MIME-Version: 1.0 ... Content-Type: multipart/mixed; boundary="AAA" diff --git a/Mailman/rules/docs/implicit-dest.txt b/Mailman/rules/docs/implicit-dest.txt index 5a7f06c0c..a43ad40cd 100644 --- a/Mailman/rules/docs/implicit-dest.txt +++ b/Mailman/rules/docs/implicit-dest.txt @@ -15,7 +15,7 @@ mailing list's posting address isn't included in the explicit recipients. >>> mlist.require_explicit_destination = True >>> mlist.acceptable_aliases = u'' - >>> msg = message_from_string(u"""\ + >>> msg = message_from_string("""\ ... From: aperson@example.org ... Subject: An implicit message ... diff --git a/Mailman/rules/docs/loop.txt b/Mailman/rules/docs/loop.txt index 8fe86cf45..9ed6ca87c 100644 --- a/Mailman/rules/docs/loop.txt +++ b/Mailman/rules/docs/loop.txt @@ -12,7 +12,7 @@ X-BeenThere header with the value of the list's posting address. The header could be missing, in which case the rule does not match. - >>> msg = message_from_string(u"""\ + >>> msg = message_from_string("""\ ... From: aperson@example.com ... ... An important message. @@ -37,7 +37,7 @@ matches. Even if there are multiple X-BeenThere headers, as long as one with the posting address exists, the rule matches. - >>> msg = message_from_string(u"""\ + >>> msg = message_from_string("""\ ... From: aperson@example.com ... X-BeenThere: not-this-list@example.com ... X-BeenThere: _xtest@example.com diff --git a/Mailman/rules/docs/max-size.txt b/Mailman/rules/docs/max-size.txt index 0d64b0cf7..03998f564 100644 --- a/Mailman/rules/docs/max-size.txt +++ b/Mailman/rules/docs/max-size.txt @@ -18,7 +18,7 @@ bigger than that will match the rule. >>> mlist.max_message_size = 1 # 1024 bytes >>> one_line = u'x' * 79 >>> big_body = u'\n'.join([one_line] * 15) - >>> msg = message_from_string(u"""\ + >>> msg = message_from_string("""\ ... From: aperson@example.com ... To: _xtest@example.com ... diff --git a/Mailman/rules/docs/moderation.txt b/Mailman/rules/docs/moderation.txt index cab8f20d3..8d71ffbf1 100644 --- a/Mailman/rules/docs/moderation.txt +++ b/Mailman/rules/docs/moderation.txt @@ -15,7 +15,7 @@ email the list without having those messages be held for approval. The In the simplest case, the sender is not a member of the mailing list, so the moderation rule can't match. - >>> msg = message_from_string(u"""\ + >>> msg = message_from_string("""\ ... From: aperson@example.org ... To: _xtest@example.com ... Subject: A posted message @@ -60,7 +60,7 @@ If the sender is a member of this mailing list, the rule does not match. But if the sender is not a member of this mailing list, the rule matches. - >>> msg = message_from_string(u"""\ + >>> msg = message_from_string("""\ ... From: bperson@example.org ... To: _xtest@example.com ... Subject: A posted message diff --git a/Mailman/rules/docs/news-moderation.txt b/Mailman/rules/docs/news-moderation.txt index f32919ce5..8d20ed69a 100644 --- a/Mailman/rules/docs/news-moderation.txt +++ b/Mailman/rules/docs/news-moderation.txt @@ -21,7 +21,7 @@ Set the list configuraiton variable to enable newsgroup moderation. And now all messages will match the rule. - >>> msg = message_from_string(u"""\ + >>> msg = message_from_string("""\ ... From: aperson@example.org ... Subject: An announcment ... diff --git a/Mailman/rules/docs/no-subject.txt b/Mailman/rules/docs/no-subject.txt index 3627ac03f..78ab22cd6 100644 --- a/Mailman/rules/docs/no-subject.txt +++ b/Mailman/rules/docs/no-subject.txt @@ -12,7 +12,7 @@ the empty string when stripped. A message with a non-empty subject does not match the rule. - >>> msg = message_from_string(u"""\ + >>> msg = message_from_string("""\ ... From: aperson@example.org ... To: _xtest@example.com ... Subject: A posted message diff --git a/Mailman/rules/docs/recipients.txt b/Mailman/rules/docs/recipients.txt index 21d04b8ae..834c33435 100644 --- a/Mailman/rules/docs/recipients.txt +++ b/Mailman/rules/docs/recipients.txt @@ -13,7 +13,7 @@ number of explicit recipients addressed by the message. In this case, we'll create a message with 5 recipients. These include all addresses in the To and CC headers. - >>> msg = message_from_string(u"""\ + >>> msg = message_from_string("""\ ... From: aperson@example.com ... To: _xtest@example.com, bperson@example.com ... Cc: cperson@example.com diff --git a/Mailman/rules/docs/suspicious.txt b/Mailman/rules/docs/suspicious.txt index 6b0eeda35..34aed22dc 100644 --- a/Mailman/rules/docs/suspicious.txt +++ b/Mailman/rules/docs/suspicious.txt @@ -14,7 +14,7 @@ confusing to users, and the list attribute that controls this is misnamed. Set the so-called suspicious header configuration variable. >>> mlist.bounce_matching_headers = u'From: .*person@(blah.)?example.com' - >>> msg = message_from_string(u"""\ + >>> msg = message_from_string("""\ ... From: aperson@example.com ... To: _xtest@example.com ... Subject: An implicit message @@ -26,7 +26,7 @@ Set the so-called suspicious header configuration variable. But if the header doesn't match the regular expression, the rule won't match. This one comes from a .org address. - >>> msg = message_from_string(u"""\ + >>> msg = message_from_string("""\ ... From: aperson@example.org ... To: _xtest@example.com ... Subject: An implicit message |
