summaryrefslogtreecommitdiff
path: root/src/mailman/commands/docs
diff options
context:
space:
mode:
authorBarry Warsaw2014-04-28 11:23:35 -0400
committerBarry Warsaw2014-04-28 11:23:35 -0400
commitd4d71f71f08d6d440b17482eecc5472dcfe6cbae (patch)
tree71f08b3d60f698883294eaa6d1bf366a095da011 /src/mailman/commands/docs
parent7536530dcd8d6303c0a869e8c9c2cb2517b9b018 (diff)
downloadmailman-d4d71f71f08d6d440b17482eecc5472dcfe6cbae.tar.gz
mailman-d4d71f71f08d6d440b17482eecc5472dcfe6cbae.tar.zst
mailman-d4d71f71f08d6d440b17482eecc5472dcfe6cbae.zip
Use print functions consistently through, and update all __future__ imports to
reflect this. Also, mock out sys.stderr on some tests so that their nose2 output is quieter. A few other minor coding style consistencies.
Diffstat (limited to 'src/mailman/commands/docs')
-rw-r--r--src/mailman/commands/docs/aliases.rst6
-rw-r--r--src/mailman/commands/docs/control.rst2
-rw-r--r--src/mailman/commands/docs/create.rst6
-rw-r--r--src/mailman/commands/docs/echo.rst10
-rw-r--r--src/mailman/commands/docs/end.rst16
-rw-r--r--src/mailman/commands/docs/help.rst18
-rw-r--r--src/mailman/commands/docs/import.rst6
-rw-r--r--src/mailman/commands/docs/info.rst2
-rw-r--r--src/mailman/commands/docs/inject.rst12
-rw-r--r--src/mailman/commands/docs/members.rst10
-rw-r--r--src/mailman/commands/docs/membership.rst78
-rw-r--r--src/mailman/commands/docs/remove.rst4
-rw-r--r--src/mailman/commands/docs/unshunt.rst4
-rw-r--r--src/mailman/commands/docs/withlist.rst6
14 files changed, 90 insertions, 90 deletions
diff --git a/src/mailman/commands/docs/aliases.rst b/src/mailman/commands/docs/aliases.rst
index 713064b0f..528a77770 100644
--- a/src/mailman/commands/docs/aliases.rst
+++ b/src/mailman/commands/docs/aliases.rst
@@ -44,14 +44,14 @@ For Postfix, there are two files in the output directory.
>>> files = sorted(os.listdir(output_directory))
>>> for file in files:
- ... print file
+ ... print(file)
postfix_domains
postfix_lmtp
The transport map file contains all the aliases for the mailing list.
>>> with open(os.path.join(output_directory, 'postfix_lmtp')) as fp:
- ... print fp.read()
+ ... print(fp.read())
# AUTOMATICALLY GENERATED BY MAILMAN ON ...
...
test@example.com lmtp:[lmtp.example.com]:24
@@ -68,7 +68,7 @@ The transport map file contains all the aliases for the mailing list.
The relay domains file contains a list of all the domains.
>>> with open(os.path.join(output_directory, 'postfix_domains')) as fp:
- ... print fp.read()
+ ... print(fp.read())
# AUTOMATICALLY GENERATED BY MAILMAN ON ...
...
example.com example.com
diff --git a/src/mailman/commands/docs/control.rst b/src/mailman/commands/docs/control.rst
index 184c5873b..b268b50a4 100644
--- a/src/mailman/commands/docs/control.rst
+++ b/src/mailman/commands/docs/control.rst
@@ -70,7 +70,7 @@ stops all the child processes too.
... except OSError as error:
... if error.errno == errno.ESRCH:
... # The process has exited.
- ... print 'Master process went bye bye'
+ ... print('Master process went bye bye')
... return
... else:
... raise
diff --git a/src/mailman/commands/docs/create.rst b/src/mailman/commands/docs/create.rst
index 6ef72e573..bec4ea8b6 100644
--- a/src/mailman/commands/docs/create.rst
+++ b/src/mailman/commands/docs/create.rst
@@ -19,7 +19,7 @@ You cannot create a mailing list in an unknown domain.
>>> class FakeParser:
... def error(self, message):
- ... print message
+ ... print(message)
>>> command.parser = FakeParser()
>>> FakeArgs.listname = ['test@example.xx']
@@ -134,7 +134,7 @@ The language must be known to Mailman.
Created mailing list: test3@example.com
>>> mlist = list_manager.get('test3@example.com')
- >>> print mlist.preferred_language
+ >>> print(mlist.preferred_language)
<Language [fr] French>
>>> FakeArgs.language = None
@@ -158,7 +158,7 @@ The notification message is in the virgin queue.
1
>>> for message in messages:
- ... print message.msg.as_string()
+ ... print(message.msg.as_string())
MIME-Version: 1.0
...
Subject: Your new mailing list: test6@example.com
diff --git a/src/mailman/commands/docs/echo.rst b/src/mailman/commands/docs/echo.rst
index db5161e1e..32399ebfc 100644
--- a/src/mailman/commands/docs/echo.rst
+++ b/src/mailman/commands/docs/echo.rst
@@ -6,11 +6,11 @@ The mail command 'echo' simply replies with the original command and arguments
to the sender.
>>> command = config.commands['echo']
- >>> print command.name
+ >>> print(command.name)
echo
- >>> print command.argument_description
+ >>> print(command.argument_description)
[args]
- >>> print command.description
+ >>> print(command.description)
Echo back your arguments.
The original message is ignored, but the results receive the echoed command.
@@ -22,9 +22,9 @@ The original message is ignored, but the results receive the echoed command.
>>> results = Results()
>>> from mailman.email.message import Message
- >>> print command.process(mlist, Message(), {}, ('foo', 'bar'), results)
+ >>> print(command.process(mlist, Message(), {}, ('foo', 'bar'), results))
ContinueProcessing.yes
- >>> print unicode(results)
+ >>> print(unicode(results))
The results of your email command are provided below.
<BLANKLINE>
echo foo bar
diff --git a/src/mailman/commands/docs/end.rst b/src/mailman/commands/docs/end.rst
index 8cd4b2409..38c268c1c 100644
--- a/src/mailman/commands/docs/end.rst
+++ b/src/mailman/commands/docs/end.rst
@@ -6,14 +6,14 @@ The mail command processor recognized an 'end' command which tells it to stop
processing email messages.
>>> command = config.commands['end']
- >>> print command.name
+ >>> print(command.name)
end
- >>> print command.description
+ >>> print(command.description)
Stop processing commands.
The 'end' command takes no arguments.
- >>> print 'DESCRIPTION:', command.argument_description
+ >>> print('DESCRIPTION:', command.argument_description)
DESCRIPTION:
The command itself is fairly simple; it just stops command processing, and the
@@ -21,17 +21,17 @@ message isn't even looked at.
>>> mlist = create_list('test@example.com')
>>> from mailman.email.message import Message
- >>> print command.process(mlist, Message(), {}, (), None)
+ >>> print(command.process(mlist, Message(), {}, (), None))
ContinueProcessing.no
The 'stop' command is a synonym for 'end'.
>>> command = config.commands['stop']
- >>> print command.name
+ >>> print(command.name)
stop
- >>> print command.description
+ >>> print(command.description)
An alias for 'end'.
- >>> print 'DESCRIPTION:', command.argument_description
+ >>> print('DESCRIPTION:', command.argument_description)
DESCRIPTION:
- >>> print command.process(mlist, Message(), {}, (), None)
+ >>> print(command.process(mlist, Message(), {}, (), None))
ContinueProcessing.no
diff --git a/src/mailman/commands/docs/help.rst b/src/mailman/commands/docs/help.rst
index a12a4008f..bbd6c8c09 100644
--- a/src/mailman/commands/docs/help.rst
+++ b/src/mailman/commands/docs/help.rst
@@ -8,11 +8,11 @@ sending the word `help` to a mailing list's -request address.
>>> mlist = create_list('test@example.com')
>>> from mailman.commands.eml_help import Help
>>> help = Help()
- >>> print help.name
+ >>> print(help.name)
help
- >>> print help.description
+ >>> print(help.description)
Get help about available email commands.
- >>> print help.argument_description
+ >>> print(help.argument_description)
[command]
With no arguments, `help` provides a list of the available commands and a
@@ -23,9 +23,9 @@ short description of each of them.
>>> results = Results()
>>> from mailman.email.message import Message
- >>> print help.process(mlist, Message(), {}, (), results)
+ >>> print(help.process(mlist, Message(), {}, (), results))
ContinueProcessing.yes
- >>> print unicode(results)
+ >>> print(unicode(results))
The results of your email command are provided below.
<BLANKLINE>
confirm - Confirm a subscription request.
@@ -42,9 +42,9 @@ short description of each of them.
With an argument, you can get more detailed help about a specific command.
>>> results = Results()
- >>> print help.process(mlist, Message(), {}, ('help',), results)
+ >>> print(help.process(mlist, Message(), {}, ('help',), results))
ContinueProcessing.yes
- >>> print unicode(results)
+ >>> print(unicode(results))
The results of your email command are provided below.
<BLANKLINE>
help [command]
@@ -54,9 +54,9 @@ With an argument, you can get more detailed help about a specific command.
Some commands have even more detailed help.
>>> results = Results()
- >>> print help.process(mlist, Message(), {}, ('join',), results)
+ >>> print(help.process(mlist, Message(), {}, ('join',), results))
ContinueProcessing.yes
- >>> print unicode(results)
+ >>> print(unicode(results))
The results of your email command are provided below.
<BLANKLINE>
join [digest=<no|mime|plain>]
diff --git a/src/mailman/commands/docs/import.rst b/src/mailman/commands/docs/import.rst
index 2ab6f99bd..86a31d6ff 100644
--- a/src/mailman/commands/docs/import.rst
+++ b/src/mailman/commands/docs/import.rst
@@ -15,7 +15,7 @@ that into an existing mailing list in Mailman 3.0.
>>> class FakeParser:
... def error(self, message):
- ... print message
+ ... print(message)
>>> command.parser = FakeParser()
You must specify the mailing list you are importing into, and it must exist.
@@ -48,9 +48,9 @@ import, the mailing list's 'real name' has changed.
>>> FakeArgs.pickle_file = [
... resource_filename('mailman.testing', 'config.pck')]
- >>> print mlist.display_name
+ >>> print(mlist.display_name)
Import
>>> command.process(FakeArgs)
- >>> print mlist.display_name
+ >>> print(mlist.display_name)
Test
diff --git a/src/mailman/commands/docs/info.rst b/src/mailman/commands/docs/info.rst
index 2a5e691ae..8bc7579e6 100644
--- a/src/mailman/commands/docs/info.rst
+++ b/src/mailman/commands/docs/info.rst
@@ -31,7 +31,7 @@ By passing in the ``-o/--output`` option, you can print the info to a file.
>>> args.output = output_path
>>> command.process(args)
>>> with open(output_path) as fp:
- ... print fp.read()
+ ... print(fp.read())
GNU Mailman 3...
Python ...
...
diff --git a/src/mailman/commands/docs/inject.rst b/src/mailman/commands/docs/inject.rst
index 5d07e0458..63e7b0366 100644
--- a/src/mailman/commands/docs/inject.rst
+++ b/src/mailman/commands/docs/inject.rst
@@ -19,7 +19,7 @@ line.
>>> class FakeParser:
... def error(self, message):
- ... print message
+ ... print(message)
>>> command.parser = FakeParser()
It's easy to find out which queues are available.
@@ -48,14 +48,14 @@ Usually, the text of the message to inject is in a file.
>>> import os, tempfile
>>> fd, filename = tempfile.mkstemp()
>>> with os.fdopen(fd, 'w') as fp:
- ... print >> fp, """\
+ ... print("""\
... From: aperson@example.com
... To: test@example.com
... Subject: testing
... Message-ID: <aardvark>
...
... This is a test message.
- ... """
+ ... """, file=fp)
However, the mailing list name is always required.
@@ -81,7 +81,7 @@ By default, the incoming queue is used.
>>> items = get_queue_messages('in')
>>> len(items)
1
- >>> print items[0].msg.as_string()
+ >>> print(items[0].msg.as_string())
From: aperson@example.com
To: test@example.com
Subject: testing
@@ -109,7 +109,7 @@ But a different queue can be specified on the command line.
>>> items = get_queue_messages('virgin')
>>> len(items)
1
- >>> print items[0].msg.as_string()
+ >>> print(items[0].msg.as_string())
From: aperson@example.com
To: test@example.com
Subject: testing
@@ -154,7 +154,7 @@ The message text can also be provided on standard input.
>>> items = get_queue_messages('in')
>>> len(items)
1
- >>> print items[0].msg.as_string()
+ >>> print(items[0].msg.as_string())
From: bperson@example.com
To: test@example.com
Subject: another test
diff --git a/src/mailman/commands/docs/members.rst b/src/mailman/commands/docs/members.rst
index 18a916781..7b99e92f9 100644
--- a/src/mailman/commands/docs/members.rst
+++ b/src/mailman/commands/docs/members.rst
@@ -70,7 +70,7 @@ You can also output this list to a file.
>>> os.close(fd)
>>> command.process(args)
>>> with open(args.output_filename) as fp:
- ... print fp.read()
+ ... print(fp.read())
Anne Person <anne@aaaxample.com>
Anne Person <anne@example.com>
Bart Person <bart@example.com>
@@ -213,7 +213,7 @@ need a file containing email addresses and full names that can be parsed by
... 'Bart Person <bperson@example.com>',
... 'cperson@example.com (Cate Person)',
... ):
- ... print >> fp, address
+ ... print(address, file=fp)
>>> args.input_filename = path
>>> args.listname = [mlist2.fqdn_listname]
@@ -236,7 +236,7 @@ taken from standard input.
... 'Elly Person <eperson@example.com>',
... 'fperson@example.com (Fred Person)',
... ):
- ... print >> fp, address
+ ... print(address, file=fp)
>>> fp.seek(0)
>>> import sys
>>> sys.stdin = fp
@@ -263,7 +263,7 @@ Blank lines and lines that begin with '#' are ignored.
... '',
... 'iperson@example.com',
... ):
- ... print >> fp, address
+ ... print(address, file=fp)
>>> args.input_filename = path
>>> command.process(args)
@@ -286,7 +286,7 @@ printed.
... 'aperson@example.com',
... 'jperson@example.com',
... ):
- ... print >> fp, address
+ ... print(address, file=fp)
>>> command.process(args)
Already subscribed (skipping): gperson@example.com
diff --git a/src/mailman/commands/docs/membership.rst b/src/mailman/commands/docs/membership.rst
index 3faccfe6a..aa3ab97e6 100644
--- a/src/mailman/commands/docs/membership.rst
+++ b/src/mailman/commands/docs/membership.rst
@@ -16,16 +16,16 @@ The mail command ``join`` subscribes an email address to the mailing list.
>>> from mailman.commands.eml_membership import Join
>>> from mailman.utilities.string import wrap
>>> join = Join()
- >>> print join.name
+ >>> print(join.name)
join
- >>> print wrap(join.description)
+ >>> print(wrap(join.description))
You will be asked to confirm your subscription request and you may be
issued a provisional password.
<BLANKLINE>
By using the 'digest' option, you can specify whether you want digest
delivery or not. If not specified, the mailing list's default
delivery mode will be used.
- >>> print join.argument_description
+ >>> print(join.argument_description)
[digest=<no|mime|plain>]
@@ -43,9 +43,9 @@ If that's missing though, then an error is returned.
>>> results = Results()
>>> from mailman.email.message import Message
- >>> print join.process(mlist, Message(), {}, (), results)
+ >>> print(join.process(mlist, Message(), {}, (), results))
ContinueProcessing.no
- >>> print unicode(results)
+ >>> print(unicode(results))
The results of your email command are provided below.
<BLANKLINE>
join: No valid address found to subscribe
@@ -55,12 +55,12 @@ The ``subscribe`` command is an alias.
>>> from mailman.commands.eml_membership import Subscribe
>>> subscribe = Subscribe()
- >>> print subscribe.name
+ >>> print(subscribe.name)
subscribe
>>> results = Results()
- >>> print subscribe.process(mlist, Message(), {}, (), results)
+ >>> print(subscribe.process(mlist, Message(), {}, (), results))
ContinueProcessing.no
- >>> print unicode(results)
+ >>> print(unicode(results))
The results of your email command are provided below.
<BLANKLINE>
subscribe: No valid address found to subscribe
@@ -77,9 +77,9 @@ When the message has a From field, that address will be subscribed.
...
... """)
>>> results = Results()
- >>> print join.process(mlist, msg, {}, (), results)
+ >>> print(join.process(mlist, msg, {}, (), results))
ContinueProcessing.yes
- >>> print unicode(results)
+ >>> print(unicode(results))
The results of your email command are provided below.
<BLANKLINE>
Confirmation email sent to Anne Person <anne@example.com>
@@ -91,7 +91,7 @@ first.
>>> from mailman.interfaces.usermanager import IUserManager
>>> from zope.component import getUtility
>>> user_manager = getUtility(IUserManager)
- >>> print user_manager.get_user('anne@example.com')
+ >>> print(user_manager.get_user('anne@example.com'))
None
Mailman has sent her the confirmation message.
@@ -100,7 +100,7 @@ Mailman has sent her the confirmation message.
>>> items = get_queue_messages('virgin')
>>> len(items)
1
- >>> print items[0].msg.as_string()
+ >>> print(items[0].msg.as_string())
MIME-Version: 1.0
...
Subject: confirm ...
@@ -148,16 +148,16 @@ list.
... """.format(token=token))
>>> results = Results()
- >>> print confirm.process(mlist, msg, {}, (token,), results)
+ >>> print(confirm.process(mlist, msg, {}, (token,), results))
ContinueProcessing.yes
- >>> print unicode(results)
+ >>> print(unicode(results))
The results of your email command are provided below.
<BLANKLINE>
Confirmed
<BLANKLINE>
>>> user = user_manager.get_user('anne@example.com')
- >>> print user.display_name
+ >>> print(user.display_name)
Anne Person
>>> list(user.addresses)
[<Address: Anne Person <anne@example.com> [verified] at ...>]
@@ -177,17 +177,17 @@ Joining a second list
... From: Anne Person <anne@example.com>
...
... """)
- >>> print join.process(mlist_2, msg, {}, (), Results())
+ >>> print(join.process(mlist_2, msg, {}, (), Results()))
ContinueProcessing.yes
Anne of course, is still registered.
- >>> print user_manager.get_user('anne@example.com')
+ >>> print(user_manager.get_user('anne@example.com'))
<User "Anne Person" (...) at ...>
But she is not a member of the mailing list.
- >>> print mlist_2.members.get_member('anne@example.com')
+ >>> print(mlist_2.members.get_member('anne@example.com'))
None
One Anne confirms this subscription, she becomes a member of the mailing
@@ -206,15 +206,15 @@ list.
... """.format(token=token))
>>> results = Results()
- >>> print confirm.process(mlist_2, msg, {}, (token,), results)
+ >>> print(confirm.process(mlist_2, msg, {}, (token,), results))
ContinueProcessing.yes
- >>> print unicode(results)
+ >>> print(unicode(results))
The results of your email command are provided below.
<BLANKLINE>
Confirmed
<BLANKLINE>
- >>> print mlist_2.members.get_member('anne@example.com')
+ >>> print(mlist_2.members.get_member('anne@example.com'))
<Member: Anne Person <anne@example.com>
on baker@example.com as MemberRole.member>
@@ -227,9 +227,9 @@ list. ``unsubscribe`` is an alias for ``leave``.
>>> from mailman.commands.eml_membership import Leave
>>> leave = Leave()
- >>> print leave.name
+ >>> print(leave.name)
leave
- >>> print leave.description
+ >>> print(leave.description)
Leave this mailing list.
<BLANKLINE>
You may be asked to confirm your request.
@@ -239,9 +239,9 @@ to leave it. She sends a message to the ``-leave`` address for the list and
is sent a confirmation message for her request.
>>> results = Results()
- >>> print leave.process(mlist_2, msg, {}, (), results)
+ >>> print(leave.process(mlist_2, msg, {}, (), results))
ContinueProcessing.yes
- >>> print unicode(results)
+ >>> print(unicode(results))
The results of your email command are provided below.
<BLANKLINE>
Anne Person <anne@example.com> left baker@example.com
@@ -249,7 +249,7 @@ is sent a confirmation message for her request.
Anne is no longer a member of the mailing list.
- >>> print mlist_2.members.get_member('anne@example.com')
+ >>> print(mlist_2.members.get_member('anne@example.com'))
None
Anne does not need to leave a mailing list with the same email address she's
@@ -261,7 +261,7 @@ will do.
>>> address = anne.register('anne.person@example.org')
>>> results = Results()
- >>> print mlist.members.get_member('anne@example.com')
+ >>> print(mlist.members.get_member('anne@example.com'))
<Member: Anne Person <anne@example.com>
on alpha@example.com as MemberRole.member>
@@ -275,16 +275,16 @@ Since Anne's alternative address has not yet been verified, it can't be used
to unsubscribe Anne from the alpha mailing list.
::
- >>> print leave.process(mlist, msg, {}, (), results)
+ >>> print(leave.process(mlist, msg, {}, (), results))
ContinueProcessing.no
- >>> print unicode(results)
+ >>> print(unicode(results))
The results of your email command are provided below.
<BLANKLINE>
Invalid or unverified email address: anne.person@example.org
<BLANKLINE>
- >>> print mlist.members.get_member('anne@example.com')
+ >>> print(mlist.members.get_member('anne@example.com'))
<Member: Anne Person <anne@example.com>
on alpha@example.com as MemberRole.member>
@@ -296,16 +296,16 @@ unsubscribe her from the list.
>>> address.verified_on = now()
>>> results = Results()
- >>> print leave.process(mlist, msg, {}, (), results)
+ >>> print(leave.process(mlist, msg, {}, (), results))
ContinueProcessing.yes
- >>> print unicode(results)
+ >>> print(unicode(results))
The results of your email command are provided below.
<BLANKLINE>
Anne Person <anne.person@example.org> left alpha@example.com
<BLANKLINE>
- >>> print mlist.members.get_member('anne@example.com')
+ >>> print(mlist.members.get_member('anne@example.com'))
None
@@ -320,7 +320,7 @@ Bart wants to join the alpha list, so he sends his subscription request.
...
... """)
- >>> print join.process(mlist, msg, {}, (), Results())
+ >>> print(join.process(mlist, msg, {}, (), Results()))
ContinueProcessing.yes
There are two messages in the virgin queue, one of which is the confirmation
@@ -335,7 +335,7 @@ message.
Bart is still not a user.
- >>> print user_manager.get_user('bart@example.com')
+ >>> print(user_manager.get_user('bart@example.com'))
None
Bart replies to the original message, specifically keeping the Subject header
@@ -351,10 +351,10 @@ a user of the system.
... """.format(token=token))
>>> results = Results()
- >>> print confirm.process(mlist, msg, {}, (token,), results)
+ >>> print(confirm.process(mlist, msg, {}, (token,), results))
ContinueProcessing.yes
- >>> print unicode(results)
+ >>> print(unicode(results))
The results of your email command are provided below.
<BLANKLINE>
Confirmed
@@ -362,11 +362,11 @@ a user of the system.
Now Bart is a user...
- >>> print user_manager.get_user('bart@example.com')
+ >>> print(user_manager.get_user('bart@example.com'))
<User "Bart Person" (...) at ...>
...and a member of the mailing list.
- >>> print mlist.members.get_member('bart@example.com')
+ >>> print(mlist.members.get_member('bart@example.com'))
<Member: Bart Person <bart@example.com>
on alpha@example.com as MemberRole.member>
diff --git a/src/mailman/commands/docs/remove.rst b/src/mailman/commands/docs/remove.rst
index 35dc53c5e..c534741f3 100644
--- a/src/mailman/commands/docs/remove.rst
+++ b/src/mailman/commands/docs/remove.rst
@@ -25,7 +25,7 @@ A system administrator can remove mailing lists by the command line.
>>> command.process(args)
Removed list: test@example.com
- >>> print list_manager.get('test@example.com')
+ >>> print(list_manager.get('test@example.com'))
None
You can also remove lists quietly.
@@ -37,5 +37,5 @@ You can also remove lists quietly.
>>> args.quiet = True
>>> command.process(args)
- >>> print list_manager.get('test@example.com')
+ >>> print(list_manager.get('test@example.com'))
None
diff --git a/src/mailman/commands/docs/unshunt.rst b/src/mailman/commands/docs/unshunt.rst
index ce9d70316..93d89f001 100644
--- a/src/mailman/commands/docs/unshunt.rst
+++ b/src/mailman/commands/docs/unshunt.rst
@@ -45,7 +45,7 @@ queue.
>>> items = get_queue_messages('in')
>>> len(items)
1
- >>> print items[0].msg.as_string()
+ >>> print(items[0].msg.as_string())
From: aperson@example.com
To: test@example.com
Subject: A broken message
@@ -121,7 +121,7 @@ The message is automatically re-queued to the bounces queue.
>>> len(items)
1
- >>> print items[0].msg.as_string()
+ >>> print(items[0].msg.as_string())
From: aperson@example.com
To: test@example.com
Subject: A broken message
diff --git a/src/mailman/commands/docs/withlist.rst b/src/mailman/commands/docs/withlist.rst
index 99a366c9a..827d246cd 100644
--- a/src/mailman/commands/docs/withlist.rst
+++ b/src/mailman/commands/docs/withlist.rst
@@ -27,7 +27,7 @@ Because ``withlist`` is so complex, you need to request detailed help.
>>> class FakeParser:
... def error(self, message):
- ... print message
+ ... print(message)
>>> command.parser = FakeParser()
>>> args = FakeArgs()
@@ -50,13 +50,13 @@ single argument, the mailing list.
>>> sys.path.insert(0, config.VAR_DIR)
>>> with open(os.path.join(config.VAR_DIR, 'showme.py'), 'w') as fp:
- ... print >> fp, """\
+ ... print("""\
... def showme(mailing_list):
... print "The list's name is", mailing_list.fqdn_listname
...
... def displayname(mailing_list):
... print "The list's display name is", mailing_list.display_name
- ... """
+ ... """, file=fp)
If the name of the function is the same as the module, then you only need to
name the function once.