[Mailman-checkins] [Git][mailman/mailman] Deleted branch naming

2018-07-11 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw deleted branch naming at GNU Mailman / Mailman Core

-- 

You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman] Pushed new branch naming

2018-07-11 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed new branch naming at GNU Mailman / Mailman Core

-- 
View it on GitLab: https://gitlab.com/mailman/mailman/tree/naming
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][release-3.1] 2 commits: Update NEWS.rst and version.py for 3.1.1 release.

2017-11-18 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch release-3.1 at mailman / Mailman Core


Commits:
9a0516c5 by Abhilash Raj at 2017-11-17T17:28:43-08:00
Update NEWS.rst and version.py for 3.1.1 release.

- - - - -
e103ec97 by Barry Warsaw at 2017-11-18T21:04:15+00:00
Merge branch release-3.1 into release-3.1

Update NEWS.rst and version.py for 3.1.1 release.

See merge request mailman/mailman!347
- - - - -


2 changed files:

- src/mailman/docs/NEWS.rst
- src/mailman/version.py


Changes:

=
src/mailman/docs/NEWS.rst
=
--- a/src/mailman/docs/NEWS.rst
+++ b/src/mailman/docs/NEWS.rst
@@ -9,7 +9,7 @@ Here is a history of user visible changes to Mailman.
 
 3.1.1
 =
-(201X-XX-XXX)
+(2017-11-17)
 
 Bugs
 


=
src/mailman/version.py
=
--- a/src/mailman/version.py
+++ b/src/mailman/version.py
@@ -18,7 +18,7 @@
 """Mailman version strings."""
 
 # Mailman version.
-VERSION = '3.1.1a1'
+VERSION = '3.1.1'
 CODENAME = 'Between The Wheels'
 
 # And as a hex number in the manner of PY_VERSION_HEX.



View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/7725a8d6235520640abeace7744964a8eee9c846...e103ec970ad66d0e389099c4f564d17053236c11

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/7725a8d6235520640abeace7744964a8eee9c846...e103ec970ad66d0e389099c4f564d17053236c11
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][release-3.1] There won't be any 3.1.1 pre-releases

2017-11-18 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch release-3.1 at mailman / Mailman Core


Commits:
8207caa0 by Barry Warsaw at 2017-11-18T16:05:22-05:00
There wont be any 3.1.1 pre-releases

- - - - -


1 changed file:

- src/mailman/version.py


Changes:

=
src/mailman/version.py
=
--- a/src/mailman/version.py
+++ b/src/mailman/version.py
@@ -32,7 +32,7 @@ FINAL = 0xf
 MAJOR_REV = 3
 MINOR_REV = 1
 MICRO_REV = 1
-REL_LEVEL = ALPHA
+REL_LEVEL = FINAL
 # At most 15 beta releases!
 REL_SERIAL = 0
 



View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/8207caa09336690da6e8a87506fd674e70b3cb4a

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/8207caa09336690da6e8a87506fd674e70b3cb4a
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][master] 2 commits: Don't assume the list-id from the list fqdn

2017-11-10 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch master at mailman / Mailman Core


Commits:
8071d4a2 by Aurélien Bompard at 2017-11-09T23:04:44+01:00
Dont assume the list-id from the list fqdn

Fixes: #428

- - - - -
06764cdd by Barry Warsaw at 2017-11-10T15:25:46+00:00
Merge branch fix-renaming into master

Dont assume the list-id from the list fqdn

Closes #428

See merge request mailman/mailman!334
- - - - -


5 changed files:

- src/mailman/docs/NEWS.rst
- src/mailman/model/listmanager.py
- src/mailman/model/tests/test_listmanager.py
- src/mailman/runners/lmtp.py
- src/mailman/runners/tests/test_lmtp.py


Changes:

=
src/mailman/docs/NEWS.rst
=
--- a/src/mailman/docs/NEWS.rst
+++ b/src/mailman/docs/NEWS.rst
@@ -40,6 +40,7 @@ Bugs
   subaddresses can now be posted to.  (Closes #433)
 * The ``admin`` subaddress, a synonym for ``bounces`` and deprecated since
   Mailman 2.1, has been removed.  (Closes #435)
+* Better support for changing the ``list_name`` property.  (Closes #428)
 
 Command line
 


=
src/mailman/model/listmanager.py
=
--- a/src/mailman/model/listmanager.py
+++ b/src/mailman/model/listmanager.py
@@ -74,8 +74,8 @@ class ListManager:
 def get_by_fqdn(self, store, fqdn_listname):
 """See `IListManager`."""
 listname, at, hostname = fqdn_listname.partition('@')
-list_id = '{}.{}'.format(listname, hostname)
-return store.query(MailingList).filter_by(_list_id=list_id).first()
+return store.query(MailingList).filter_by(
+list_name=listname, mail_host=hostname).first()
 
 @dbconnection
 def delete(self, store, mlist):


=
src/mailman/model/tests/test_listmanager.py
=
--- a/src/mailman/model/tests/test_listmanager.py
+++ b/src/mailman/model/tests/test_listmanager.py
@@ -153,6 +153,15 @@ class TestListManager(unittest.TestCase):
 self.assertEqual(list_manager.get_by_fqdn('a...@example.com'), ant)
 self.assertIsNone(list_manager.get_by_fqdn('ant.example.com'))
 
+def test_find_by_fqdn_renamed(self):
+ant = create_list('a...@example.com')
+ant.list_name = 'renamed'
+self.assertEqual(ant.posting_address, 'rena...@example.com')
+self.assertEqual(ant.list_id, 'ant.example.com')
+list_manager = getUtility(IListManager)
+self.assertEqual(list_manager.get_by_fqdn('rena...@example.com'), ant)
+self.assertIsNone(list_manager.get_by_fqdn('a...@example.com'))
+
 
 class TestListLifecycleEvents(unittest.TestCase):
 layer = ConfigLayer


=
src/mailman/runners/lmtp.py
=
--- a/src/mailman/runners/lmtp.py
+++ b/src/mailman/runners/lmtp.py
@@ -165,12 +165,12 @@ class LMTPHandler:
 if listname not in listnames:
 status.append(ERR_550)
 continue
-listid = '{}.{}'.format(local, domain)
+mlist = getUtility(IListManager).get_by_fqdn(listname)
 # The recipient is a valid mailing list.  Find the subaddress
 # if there is one, and set things up to enqueue to the proper
 # queue.
 queue = None
-msgdata = dict(listid=listid,
+msgdata = dict(listid=mlist.list_id,
original_size=msg.original_size,
received_time=received_time)
 canonical_subaddress = SUBADDRESS_NAMES.get(subaddress)


=
src/mailman/runners/tests/test_lmtp.py
=
--- a/src/mailman/runners/tests/test_lmtp.py
+++ b/src/mailman/runners/tests/test_lmtp.py
@@ -197,6 +197,24 @@ Subject: This will be recognized as a post to the -join 
list.
 get_queue_messages('in', expected_count=1)
 get_queue_messages('command', expected_count=0)
 
+def test_mailing_list_with_different_address_and_list_id(self):
+# A mailing list can be renamed, in which case the list_name
+# will be different but the list_id will remain the same.
+# https://gitlab.com/mailman/mailman/issues/428
+with transaction():
+self._mlist.list_name = 'renamed'
+self.assertEqual(self._mlist.posting_address, 'rena...@example.com')
+self._lmtp.sendmail('a...@example.com', ['rena...@example.com'], """\
+From: a...@example.com
+To: rena...@example.com
+Message-ID: 
+Subject: This should be accepted.
+
+""")
+# The message is in the incoming queue but not the command queue.
+items = get_queue_messages('in', expected_count=1)
+self.assertEqual(items[0].msgdata['listid'], 'test.example.com')
+
 
 class TestBugs(unittest.TestCase):
 """Test some LMTP related bugs."""



[Mailman-checkins] [Git][mailman/mailman][master] 2 commits: Remove deprecated 'admin' subaddress.

2017-11-05 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch master at mailman / Mailman Core


Commits:
46496dbd by Mark Sapiro at 2017-11-05T14:11:26-08:00
Remove deprecated admin subaddress.

- - - - -
31f434d0 by Barry Warsaw at 2017-11-05T23:43:26+00:00
Merge branch admin into master

Remove deprecated admin subaddress.

Closes #435

See merge request mailman/mailman!342
- - - - -


2 changed files:

- src/mailman/docs/NEWS.rst
- src/mailman/runners/lmtp.py


Changes:

=
src/mailman/docs/NEWS.rst
=
--- a/src/mailman/docs/NEWS.rst
+++ b/src/mailman/docs/NEWS.rst
@@ -38,6 +38,8 @@ Bugs
   via REST.  (Closes #418)
 * A list whose name is one of the ``admin``, ``bounces``, ``confirm``, etc.
   subaddresses can now be posted to.  (Closes #433)
+* The ``admin`` subaddress, a synonym for ``bounces`` and deprecated since
+  Mailman 2.1, has been removed.  (Closes #435)
 
 Command line
 


=
src/mailman/runners/lmtp.py
=
--- a/src/mailman/runners/lmtp.py
+++ b/src/mailman/runners/lmtp.py
@@ -63,7 +63,6 @@ slog = logging.getLogger('mailman.smtp')
 # listname-request@.  This maps user visible subaddress names (which may
 # include aliases) to the internal canonical subaddress name.
 SUBADDRESS_NAMES = dict(
-admin='bounces',
 bounces='bounces',
 confirm='confirm',
 join='join',



View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/1e9a9268a3b8d120188e174b08b0ddc593135034...31f434d0866dbab5ebb4748fa9987eaac475eb0d

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/1e9a9268a3b8d120188e174b08b0ddc593135034...31f434d0866dbab5ebb4748fa9987eaac475eb0d
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][master] 2 commits: A list whose name is one of the subaddresses can now be posted to.

2017-10-29 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch master at mailman / Mailman Core


Commits:
b6d78543 by Mark Sapiro at 2017-10-28T07:23:18-07:00
A list whose name is one of the subaddresses can now be posted to.

- - - - -
1e9a9268 by Barry Warsaw at 2017-10-29T17:05:45+00:00
Merge branch subname into master

A list whose name is one of the subaddresses can now be posted to.

Closes #433

See merge request mailman/mailman!338
- - - - -


3 changed files:

- src/mailman/docs/NEWS.rst
- src/mailman/runners/lmtp.py
- src/mailman/runners/tests/test_lmtp.py


Changes:

=
src/mailman/docs/NEWS.rst
=
--- a/src/mailman/docs/NEWS.rst
+++ b/src/mailman/docs/NEWS.rst
@@ -36,6 +36,8 @@ Bugs
   rule.  (Closes #414)
 * Invalid regexps in header_matches rules are properly logged and can't be set
   via REST.  (Closes #418)
+* A list whose name is one of the ``admin``, ``bounces``, ``confirm``, etc.
+  subaddresses can now be posted to.  (Closes #433)
 
 Command line
 


=
src/mailman/runners/lmtp.py
=
--- a/src/mailman/runners/lmtp.py
+++ b/src/mailman/runners/lmtp.py
@@ -111,11 +111,8 @@ def split_recipient(address):
 """
 localpart, domain = address.split('@', 1)
 localpart = localpart.split(config.mta.verp_delimiter, 1)[0]
-parts = localpart.split(DASH)
-if parts[-1] in SUBADDRESS_NAMES:
-listname = DASH.join(parts[:-1])
-subaddress = parts[-1]
-else:
+listname, dash, subaddress = localpart.rpartition('-')
+if subaddress not in SUBADDRESS_NAMES or listname == '' or dash == '':
 listname = localpart
 subaddress = None
 return listname, subaddress, domain


=
src/mailman/runners/tests/test_lmtp.py
=
--- a/src/mailman/runners/tests/test_lmtp.py
+++ b/src/mailman/runners/tests/test_lmtp.py
@@ -165,6 +165,38 @@ Subject: This will be recognized as a join command.
 get_queue_messages('in', expected_count=0)
 get_queue_messages('command', expected_count=1)
 
+def test_mailing_list_with_subaddress_name(self):
+# Test that we can post to a list whose name is a subaddress.
+with transaction():
+create_list('j...@example.com')
+self._lmtp.sendmail('a...@example.com',
+['j...@example.com'], """\
+From: a...@example.com
+To: j...@example.com
+Message-ID: 
+Subject: This will be recognized as a post to the join list.
+
+""")
+# The message is in the incoming queue but not the command queue.
+get_queue_messages('in', expected_count=1)
+get_queue_messages('command', expected_count=0)
+
+def test_mailing_list_with_subaddress_dash_name(self):
+# Test that we can post to a list whose name is -subaddress.
+with transaction():
+create_list('-j...@example.com')
+self._lmtp.sendmail('a...@example.com',
+['-j...@example.com'], """\
+From: a...@example.com
+To: -j...@example.com
+Message-ID: 
+Subject: This will be recognized as a post to the -join list.
+
+""")
+# The message is in the incoming queue but not the command queue.
+get_queue_messages('in', expected_count=1)
+get_queue_messages('command', expected_count=0)
+
 
 class TestBugs(unittest.TestCase):
 """Test some LMTP related bugs."""



View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/d8ec8de8a2df0b729c46d9c1a9005c56e3999656...1e9a9268a3b8d120188e174b08b0ddc593135034

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/d8ec8de8a2df0b729c46d9c1a9005c56e3999656...1e9a9268a3b8d120188e174b08b0ddc593135034
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][master] 2 commits: Avoid new flake8 3.5.0 E722, bare except:.

2017-10-27 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch master at mailman / Mailman Core


Commits:
e89d682b by Mark Sapiro at 2017-10-27T08:42:31-07:00
Avoid new flake8 3.5.0 E722, bare except:.

- - - - -
d8ec8de8 by Barry Warsaw at 2017-10-27T18:43:34+00:00
Merge branch flake8 into master

Add an ignore to flake8 in tox.ini.

Closes #431

See merge request mailman/mailman!335
- - - - -


4 changed files:

- src/mailman/app/workflow.py
- src/mailman/core/logging.py
- src/mailman/database/model.py
- src/mailman/database/transaction.py


Changes:

=
src/mailman/app/workflow.py
=
--- a/src/mailman/app/workflow.py
+++ b/src/mailman/app/workflow.py
@@ -69,7 +69,7 @@ class Workflow:
 return step()
 except IndexError:
 raise StopIteration
-except:
+except: # noqa: E722
 log.exception('deque: {}'.format(COMMASPACE.join(self._next)))
 raise
 


=
src/mailman/core/logging.py
=
--- a/src/mailman/core/logging.py
+++ b/src/mailman/core/logging.py
@@ -70,7 +70,7 @@ class ReopenableFileHandler(logging.Handler):
 if msg[-1] != '\n':
 stream.write('\n')
 self.flush()
-except:
+except:  # noqa: E722 pragma: nocover
 self.handleError(record)
 
 def close(self):


=
src/mailman/database/model.py
=
--- a/src/mailman/database/model.py
+++ b/src/mailman/database/model.py
@@ -39,7 +39,7 @@ class ModelMeta:
 # order.  http://tinyurl.com/on8dy6f
 for table in reversed(Model.metadata.sorted_tables):
 connection.execute(table.delete())
-except:
+except: # noqa: E722 pragma: nocover
 transaction.rollback()
 raise
 else:


=
src/mailman/database/transaction.py
=
--- a/src/mailman/database/transaction.py
+++ b/src/mailman/database/transaction.py
@@ -28,7 +28,7 @@ def transaction():
 """Context manager for ensuring the transaction is complete."""
 try:
 yield
-except:
+except:  # noqa: E722
 config.db.abort()
 raise
 else:
@@ -50,7 +50,7 @@ def transactional(function):
 rtn = function(*args, **kws)
 config.db.commit()
 return rtn
-except:
+except:  # noqa: E722 pragma: nocover
 config.db.abort()
 raise
 return wrapper



View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/500076718eb565845f3a0d107d584cd15c539406...d8ec8de8a2df0b729c46d9c1a9005c56e3999656

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/500076718eb565845f3a0d107d584cd15c539406...d8ec8de8a2df0b729c46d9c1a9005c56e3999656
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][master] 2 commits: Use MySQL 5.6 since the latest emits warnings not handled by PyMYSQL.

2017-10-17 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch master at mailman / Mailman Core


Commits:
6345fb9e by Abhilash Raj at 2017-10-17T13:48:44-07:00
Use MySQL 5.6 since the latest emits warnings not handled by PyMYSQL.

- - - - -
46cd88f6 by Barry Warsaw at 2017-10-17T21:27:51+00:00
Merge branch fix-mysql-builds into master

Use MySQL 5.6 since the latest emits warnings not handled by PyMYSQL.

See merge request mailman/mailman!332
- - - - -


1 changed file:

- .gitlab-ci.yml


Changes:

=
.gitlab-ci.yml
=
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -34,7 +34,7 @@ pgsql:
 
 mysql:
   services:
-  - mysql:latest
+  - mysql:5.6
   script:
   - MAILMAN_EXTRA_TESTING_CFG=/home/runner/configs/mysql.cfg tox -e 
py35-nocov-mysql,py36-nocov-mysql
   tags:



View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/b0663b08574f263a368d602a1a4d6cbddcf98aa3...46cd88f68bee9ad31e83e114a26c4f8b0ce96a53

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/b0663b08574f263a368d602a1a4d6cbddcf98aa3...46cd88f68bee9ad31e83e114a26c4f8b0ce96a53
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][master] 2 commits: Work around a bug/change in Alembic

2017-10-16 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch master at mailman / Mailman Core


Commits:
24f2439a by Barry Warsaw at 2017-10-16T11:02:36-04:00
Work around a bug/change in Alembic

In Alembic 0.9.6, they changed something which breaks the @public decorator on
these methods.

- - - - -
b0663b08 by Barry Warsaw at 2017-10-17T03:06:53+00:00
Merge branch issue423 into master

Work around a bug/change in Alembic

Closes #423

See merge request mailman/mailman!330
- - - - -


1 changed file:

- src/mailman/database/alembic/env.py


Changes:

=
src/mailman/database/alembic/env.py
=
--- a/src/mailman/database/alembic/env.py
+++ b/src/mailman/database/alembic/env.py
@@ -23,7 +23,6 @@ from mailman.config import config
 from mailman.core.initialize import initialize_1
 from mailman.database.model import Model
 from mailman.utilities.string import expand
-from public import public
 from sqlalchemy import create_engine
 
 
@@ -35,7 +34,7 @@ except AttributeError:
 url = expand(config.database.url, None, config.paths)
 
 
-@public
+# We can't use @public here.  See GL#423
 def run_migrations_offline():
 """Run migrations in 'offline' mode.
 
@@ -51,7 +50,7 @@ def run_migrations_offline():
 context.run_migrations()
 
 
-@public
+# We can't use @public here.  See GL#423
 def run_migrations_online():
 """Run migrations in 'online' mode.
 



View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/32d3620e6e20e750f1b0c15b3648e4f4e703789c...b0663b08574f263a368d602a1a4d6cbddcf98aa3

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/32d3620e6e20e750f1b0c15b3648e4f4e703789c...b0663b08574f263a368d602a1a4d6cbddcf98aa3
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman] Pushed new branch issue423

2017-10-16 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed new branch issue423 at mailman / Mailman Core

---
View it on GitLab: https://gitlab.com/mailman/mailman/tree/issue423
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][master] Add a NEWS entry

2017-10-12 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch master at mailman / Mailman Core


Commits:
32d3620e by Barry Warsaw at 2017-10-12T10:15:04-04:00
Add a NEWS entry

- - - - -


1 changed file:

- src/mailman/docs/NEWS.rst


Changes:

=
src/mailman/docs/NEWS.rst
=
--- a/src/mailman/docs/NEWS.rst
+++ b/src/mailman/docs/NEWS.rst
@@ -32,6 +32,8 @@ Bugs
   of the list's preferred_language.  (Closes #395 and #413)
 * Thanks to Jim Popovitch, certain failures in DNS lookups of DMARC policy
   will now result in mitigations being applied.  (Closes #415)
+* Messages without a sender can no longer bypass the ``nonmember-moderation``
+  rule.  (Closes #414)
 
 Command line
 



View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/32d3620e6e20e750f1b0c15b3648e4f4e703789c

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/32d3620e6e20e750f1b0c15b3648e4f4e703789c
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][master] 2 commits: Use list litteral for list creation

2017-10-12 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch master at mailman / Mailman Core


Commits:
aa912dd9 by Rémy Léone at 2017-10-09T12:49:28+02:00
Use list litteral for list creation

- - - - -
b2de80c4 by Barry Warsaw at 2017-10-12T14:11:45+00:00
Merge branch list_litteral into master

Use inline list literal rather than append()

See merge request mailman/mailman!328
- - - - -


1 changed file:

- src/mailman/handlers/tagger.py


Changes:

=
src/mailman/handlers/tagger.py
=
--- a/src/mailman/handlers/tagger.py
+++ b/src/mailman/handlers/tagger.py
@@ -38,9 +38,7 @@ def process(mlist, msg, msgdata):
 if not mlist.topics_enabled:
 return
 # Extract the Subject:, Keywords:, and possibly body text
-matchlines = []
-matchlines.append(msg.get('subject', None))
-matchlines.append(msg.get('keywords', None))
+matchlines = [msg.get('subject', None), msg.get('keywords', None)]
 if mlist.topics_bodylines_limit == 0:
 # Don't scan any body lines
 pass



View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/b06af6e3968b0051faf6f9ff29ff2a39c575ec14...b2de80c4217d7b425f7047bc459b86f1bbb0f3e9

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/b06af6e3968b0051faf6f9ff29ff2a39c575ec14...b2de80c4217d7b425f7047bc459b86f1bbb0f3e9
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][master] 2 commits: Protect against messages without a sender

2017-10-12 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch master at mailman / Mailman Core


Commits:
c53b2c91 by Aurélien Bompard at 2017-10-06T17:46:27+02:00
Protect against messages without a sender

Fixes: #414

- - - - -
83f5bfbc by Barry Warsaw at 2017-10-12T14:13:36+00:00
Merge branch fix/empty-sender into master

Protect against messages without a sender

Closes #414

See merge request mailman/mailman!324
- - - - -


2 changed files:

- src/mailman/rules/moderation.py
- src/mailman/rules/tests/test_moderation.py


Changes:

=
src/mailman/rules/moderation.py
=
--- a/src/mailman/rules/moderation.py
+++ b/src/mailman/rules/moderation.py
@@ -117,6 +117,13 @@ class NonmemberModeration:
 for sender in msg.senders:
 if ban_manager.is_banned(sender):
 return False
+if len(msg.senders) == 0:
+with _.defer_translation():
+# This will be translated at the point of use.
+reason = _('No sender was found in the message.')
+_record_action(
+msgdata, mlist.default_nonmember_action, 'No sender', reason)
+return True
 # Every sender email must be a member or nonmember directly.  If it is
 # neither, make the email a nonmembers.
 for sender in msg.senders:
@@ -141,8 +148,9 @@ class NonmemberModeration:
 # Check the '*_these_nonmembers' properties first.  XXX These are
 # legacy attributes from MM2.1; their database type is 'pickle' and
 # they should eventually get replaced.
-for action in ('accept', 'hold', 'reject', 'discard'):
-legacy_attribute_name = '{}_these_nonmembers'.format(action)
+for action_name in ('accept', 'hold', 'reject', 'discard'):
+legacy_attribute_name = '{}_these_nonmembers'.format(
+action_name)
 checklist = getattr(mlist, legacy_attribute_name)
 for addr in checklist:
 if ((addr.startswith('^') and re.match(addr, sender))
@@ -151,8 +159,8 @@ class NonmemberModeration:
 # This will be translated at the point of use.
 reason = (
 _('The sender is in the nonmember {} list'),
-action)
-_record_action(msgdata, action, sender, reason)
+action_name)
+_record_action(msgdata, action_name, sender, reason)
 return True
 action = (mlist.default_nonmember_action
   if nonmember.moderation_action is None


=
src/mailman/rules/tests/test_moderation.py
=
--- a/src/mailman/rules/tests/test_moderation.py
+++ b/src/mailman/rules/tests/test_moderation.py
@@ -306,3 +306,25 @@ A message body.
 """)
 result = rule.check(self._mlist, msg, {})
 self.assertFalse(result)
+
+def test_no_senders(self):
+rule = moderation.NonmemberModeration()
+# Message without a From
+msg = mfs("""\
+To: t...@example.com
+Subject: A test message
+Message-ID: 
+MIME-Version: 1.0
+
+A message body.
+""")
+self.assertEqual(msg.senders, [])
+msgdata = {}
+# The NonmemberModeration rule should hit.
+result = rule.check(self._mlist, msg, msgdata)
+self.assertTrue(result, 'NonmemberModeration rule should hit')
+self.assertEqual(msgdata, {
+'member_moderation_action': Action.hold,
+'moderation_reasons': ['No sender was found in the message.'],
+'moderation_sender': 'No sender',
+})



View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/b2de80c4217d7b425f7047bc459b86f1bbb0f3e9...83f5bfbc8c5d9184ef2883f8eebc4e3f787d3da0

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/b2de80c4217d7b425f7047bc459b86f1bbb0f3e9...83f5bfbc8c5d9184ef2883f8eebc4e3f787d3da0
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][master] 2 commits: Warn method is deprecated

2017-10-12 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch master at mailman / Mailman Core


Commits:
3a3dbeb4 by Rémy Léone at 2017-10-09T12:50:48+02:00
Warn method is deprecated

- - - - -
b06af6e3 by Barry Warsaw at 2017-10-12T14:00:33+00:00
Merge branch deprecated_warn into master

Warn method is deprecated

See merge request mailman/mailman!327
- - - - -


1 changed file:

- src/mailman/core/initialize.py


Changes:

=
src/mailman/core/initialize.py
=
--- a/src/mailman/core/initialize.py
+++ b/src/mailman/core/initialize.py
@@ -157,7 +157,7 @@ def initialize_2(debug=False, propagate_logs=None, 
testing=False):
 config = mailman.config.config
 if len(config.mailman.pre_hook) > 0:# pragma: nocover
 log = logging.getLogger('mailman.plugins')
-log.warn(
+log.warning(
 'The [mailman]pre_hook configuration value has been replaced '
 "by the plugins infrastructure, and won't be called.")
 # Run the plugin pre_hooks, if one fails, disable the offending plugin.
@@ -199,7 +199,7 @@ def initialize_3():
 config = mailman.config.config
 log = logging.getLogger('mailman.plugins')
 if len(config.mailman.post_hook) > 0:   # pragma: nocover
-log.warn(
+log.warning(
 'The [mailman]post_hook configuration value has been replaced '
 "by the plugins infrastructure, and won't be called.")
 for plugin in config.plugins.values():  # pragma: nocover



View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/54ff1024a8ff32af779a2bd1085d4cd9ddd8c37e...b06af6e3968b0051faf6f9ff29ff2a39c575ec14

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/54ff1024a8ff32af779a2bd1085d4cd9ddd8c37e...b06af6e3968b0051faf6f9ff29ff2a39c575ec14
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][master] Minor formatting fix.

2017-10-12 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch master at mailman / Mailman Core


Commits:
54ff1024 by Barry Warsaw at 2017-10-12T09:27:58-04:00
Minor formatting fix.

- - - - -


1 changed file:

- src/mailman/docs/NEWS.rst


Changes:

=
src/mailman/docs/NEWS.rst
=
--- a/src/mailman/docs/NEWS.rst
+++ b/src/mailman/docs/NEWS.rst
@@ -80,7 +80,7 @@ REST
 * Allow a mailing list's acceptable aliases to be cleared by calling
   ``DELETE`` on the list's ``config/acceptable_aliases`` resource.
   (Closes #394)
-* Allow setting max_message_size for a mailing list. (Closes #417)
+* Allow setting ``max_message_size`` for a mailing list. (Closes #417)
 
 
 3.1.0 -- "Between The Wheels"



View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/54ff1024a8ff32af779a2bd1085d4cd9ddd8c37e

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/54ff1024a8ff32af779a2bd1085d4cd9ddd8c37e
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][master] 2 commits: Expose max_message_size through rest

2017-10-12 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch master at mailman / Mailman Core


Commits:
2f230e87 by Simon Hanna at 2017-10-12T01:11:21+02:00
Expose max_message_size through rest

- - - - -
50b28b01 by Barry Warsaw at 2017-10-12T13:25:17+00:00
Merge branch expose-max-message-size into master

Expose max_message_size through rest

Closes #417

See merge request mailman/mailman!329
- - - - -


6 changed files:

- src/mailman/docs/NEWS.rst
- src/mailman/rest/docs/listconf.rst
- src/mailman/rest/listconf.py
- src/mailman/rest/tests/test_listconf.py
- src/mailman/rest/tests/test_validator.py
- src/mailman/rest/validator.py


Changes:

=
src/mailman/docs/NEWS.rst
=
--- a/src/mailman/docs/NEWS.rst
+++ b/src/mailman/docs/NEWS.rst
@@ -80,6 +80,7 @@ REST
 * Allow a mailing list's acceptable aliases to be cleared by calling
   ``DELETE`` on the list's ``config/acceptable_aliases`` resource.
   (Closes #394)
+* Allow setting max_message_size for a mailing list. (Closes #417)
 
 
 3.1.0 -- "Between The Wheels"


=
src/mailman/rest/docs/listconf.rst
=
--- a/src/mailman/rest/docs/listconf.rst
+++ b/src/mailman/rest/docs/listconf.rst
@@ -62,6 +62,7 @@ All readable attributes for a list are available on a 
sub-resource.
 leave_address: ant-le...@example.com
 list_name: ant
 mail_host: example.com
+max_message_size: 40
 moderator_password: None
 next_digest_number: 1
 no_reply_address: nore...@example.com
@@ -131,6 +132,7 @@ When using ``PUT``, all writable attributes must be 
included.
 ... default_member_action='hold',
 ... default_nonmember_action='discard',
 ... moderator_password='password',
+... max_message_size='500',
 ... ),
 ...   'PUT')
 content-length: 0


=
src/mailman/rest/listconf.py
=
--- a/src/mailman/rest/listconf.py
+++ b/src/mailman/rest/listconf.py
@@ -31,7 +31,9 @@ from mailman.rest.helpers import (
 GetterSetter, bad_request, etag, no_content, not_found, okay)
 from mailman.rest.validator import (
 PatchValidator, ReadOnlyPATCHRequestError, UnknownPATCHRequestError,
-Validator, enum_validator, list_of_strings_validator)
+Validator, enum_validator, integer_ge_zero_validator,
+list_of_strings_validator
+)
 from public import public
 from zope.component import getUtility
 
@@ -168,6 +170,7 @@ ATTRIBUTES = dict(
 list_name=GetterSetter(None),
 mail_host=GetterSetter(None),
 moderator_password=GetterSetter(password_bytes_validator),
+max_message_size=GetterSetter(integer_ge_zero_validator),
 next_digest_number=GetterSetter(None),
 no_reply_address=GetterSetter(None),
 owner_address=GetterSetter(None),


=
src/mailman/rest/tests/test_listconf.py
=
--- a/src/mailman/rest/tests/test_listconf.py
+++ b/src/mailman/rest/tests/test_listconf.py
@@ -72,6 +72,7 @@ RESOURCE = dict(
 include_rfc2369_headers=False,
 info='This is the mailing list info',
 moderator_password='password',
+max_message_size='150',
 posting_pipeline='virgin',
 reply_goes_to_list='point_to_list',
 reply_to_address='b...@example.com',


=
src/mailman/rest/tests/test_validator.py
=
--- a/src/mailman/rest/tests/test_validator.py
+++ b/src/mailman/rest/tests/test_validator.py
@@ -23,7 +23,8 @@ from mailman.core.api import API30, API31
 from mailman.interfaces.action import Action
 from mailman.interfaces.usermanager import IUserManager
 from mailman.rest.validator import (
-enum_validator, list_of_strings_validator, subscriber_validator)
+enum_validator, integer_ge_zero_validator, list_of_strings_validator,
+subscriber_validator)
 from mailman.testing.layers import RESTLayer
 from zope.component import getUtility
 
@@ -41,6 +42,14 @@ class TestValidators(unittest.TestCase):
 list_of_strings_validator(['ant', 'bee', 'cat']),
 ['ant', 'bee', 'cat'])
 
+def test_integer_ge_zero_validator_invalid(self):
+self.assertRaises(ValueError, integer_ge_zero_validator, 'foo')
+self.assertRaises(ValueError, integer_ge_zero_validator, '-1')
+
+def test_integer_ge_zero_validator_valid(self):
+self.assertEquals(integer_ge_zero_validator('0'), 0)
+self.assertEquals(integer_ge_zero_validator('100'), 100)
+
 def test_list_of_strings_validator_invalid(self):
 # Strings are required.
 self.assertRaises(ValueError, list_of_strings_validator, 7)


=
src/mailman/rest/validator.py
=
--- a/src/mailman/rest/validator.py
+++ b/src/mailman/rest/validator.py
@@ -100,6 

[Mailman-checkins] [Git][mailman/mailman][master] 3 commits: Updated the DMARC rule to treat certain DNS lookup failures as needing mitigation.

2017-10-09 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch master at mailman / Mailman Core


Commits:
378be176 by Mark Sapiro at 2017-10-09T07:59:18-07:00
Updated the DMARC rule to treat certain DNS lookup failures as needing 
mitigation.

- - - - -
b794170a by Mark Sapiro at 2017-10-09T08:02:20-07:00
Rebased and fixed typo.

- - - - -
0ff35504 by Barry Warsaw at 2017-10-09T15:21:44+00:00
Merge branch dmarc into master

Updated the DMARC rule to treat certain DNS lookup failures as needing 
mitigation.

Closes #415

See merge request mailman/mailman!326
- - - - -


3 changed files:

- src/mailman/docs/NEWS.rst
- src/mailman/rules/dmarc.py
- src/mailman/rules/tests/test_dmarc.py


Changes:

=
src/mailman/docs/NEWS.rst
=
--- a/src/mailman/docs/NEWS.rst
+++ b/src/mailman/docs/NEWS.rst
@@ -30,6 +30,8 @@ Bugs
   additions to the ``-bounces`` and ``-confirm`` addresses.  (Closes #401)
 * Address confirmation notices are now properly encoded in the character set
   of the list's preferred_language.  (Closes #395 and #413)
+* Thanks to Jim Popovitch, certain failures in DNS lookups of DMARC policy
+  will now result in mitigations being applied.  (Closes #415)
 
 Command line
 


=
src/mailman/rules/dmarc.py
=
--- a/src/mailman/rules/dmarc.py
+++ b/src/mailman/rules/dmarc.py
@@ -183,11 +183,23 @@ def is_reject_or_quarantine(mlist, email, dmarc_domain, 
org=False):
 txt_recs = resolver.query(dmarc_domain, dns.rdatatype.TXT)
 except (dns.resolver.NXDOMAIN, dns.resolver.NoAnswer):
 return KEEP_LOOKING
+except (dns.resolver.NoNameservers):
+elog.error(
+'DNSException: No Nameservers available for %s (%s).',
+email, dmarc_domain)
+# Typically this means a dnssec validation error.  Clients that don't
+# perform validation *may* successfully see a _dmarc RR whereas a
+# validating mailman server won't see the _dmarc RR.  We should
+# mitigate this email to be safe.
+return True
 except DNSException as error:
 elog.error(
 'DNSException: Unable to query DMARC policy for %s (%s). %s',
 email, dmarc_domain, error.__doc__)
-return KEEP_LOOKING
+# While we can't be sure what caused the error, there is potentially
+# a DMARC policy record that we missed and that a receiver of the mail
+# might see.  Thus, we should err on the side of caution and mitigate.
+return True
 # Be as robust as possible in parsing the result.
 results_by_name = {}
 cnames = {}


=
src/mailman/rules/tests/test_dmarc.py
=
--- a/src/mailman/rules/tests/test_dmarc.py
+++ b/src/mailman/rules/tests/test_dmarc.py
@@ -24,7 +24,7 @@ from contextlib import ExitStack
 from datetime import timedelta
 from dns.exception import DNSException
 from dns.rdatatype import CNAME, TXT
-from dns.resolver import NXDOMAIN, NoAnswer
+from dns.resolver import NXDOMAIN, NoAnswer, NoNameservers
 from http.server import BaseHTTPRequestHandler, HTTPServer
 from lazr.config import as_timedelta
 from mailman.app.lifecycle import create_list
@@ -156,6 +156,8 @@ def get_dns_resolver(
 raise NoAnswer
 if dparts[2] == 'info':
 raise DNSException('no internet')
+if dparts[2] == 'home':
+raise NoNameservers
 if dparts[1] != 'example' or dparts[2] != 'biz':
 raise NXDOMAIN
 self.response = Answer()
@@ -227,7 +229,7 @@ To: a...@example.com
 mark = LogFileMark('mailman.error')
 rule = dmarc.DMARCMitigation()
 with get_dns_resolver():
-self.assertFalse(rule.check(mlist, msg, {}))
+self.assertTrue(rule.check(mlist, msg, {}))
 line = mark.readline()
 self.assertEqual(
 line[-144:],
@@ -235,6 +237,25 @@ To: a...@example.com
 'a...@example.info (_dmarc.example.info). '
 'Abstract base class shared by all dnspython exceptions.\n')
 
+def test_dmarc_nonameservers_exception(self):
+mlist = create_list('a...@example.com')
+# Use action reject.  The rule only hits on reject and discard.
+mlist.dmarc_mitigate_action = DMARCMitigateAction.reject
+msg = mfs("""\
+From: a...@example.home
+To: a...@example.com
+
+""")
+mark = LogFileMark('mailman.error')
+rule = dmarc.DMARCMitigation()
+with get_dns_resolver():
+self.assertTrue(rule.check(mlist, msg, {}))
+line = mark.readline()
+self.assertEqual(
+line[-84:],
+'DNSException: No Nameservers available for '
+'a...@example.home (_dmarc.example.home).\n')
+
 def test_cname_wrong_txt_name(self):
 mlist = create_list('a...@example.com')
  

[Mailman-checkins] [Git][mailman/mailman][master] 2 commits: Make sphinx-build ignore .pc directory

2017-09-30 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch master at mailman / Mailman Core


Commits:
7a9df143 by Jonas Meurer at 2017-10-01T00:53:55+00:00
Make sphinx-build ignore .pc directory

- - - - -
5b75ef20 by Barry Warsaw at 2017-10-01T00:53:56+00:00
Merge branch sphinx_ignore_.pc into master

Make sphinx-build ignore .pc directory

Closes #403

See merge request mailman/mailman!320
- - - - -


2 changed files:

- conf.py
- src/mailman/docs/NEWS.rst


Changes:

=
conf.py
=
--- a/conf.py
+++ b/conf.py
@@ -68,7 +68,7 @@ release = VERSION
 
 # List of patterns, relative to source directory, that match files and
 # directories to ignore when looking for source files.
-exclude_patterns = ['_build', 'eggs', '.tox']
+exclude_patterns = ['_build', 'eggs', '.tox', '.pc']
 
 # The reST default role (used for this markup: `text`) to use for all 
documents.
 #default_role = None


=
src/mailman/docs/NEWS.rst
=
--- a/src/mailman/docs/NEWS.rst
+++ b/src/mailman/docs/NEWS.rst
@@ -66,6 +66,8 @@ Other
   Jan Jancar.
 * Drop support for Python 3.4.  (Closes #373)
 * Bump minimum requirements for aiosmtpd (>= 1.1) and flufl.lock (>= 3.1).
+* Add '.pc' (patch directory) to list of ignored patterns when building the
+  documentation with Sphinx.
 
 REST
 



View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/1c50b57385fed95fc8c132f164fb73f897ba87eb...5b75ef2077432c55356ca3f9b723b6e4c54e7b3b

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/1c50b57385fed95fc8c132f164fb73f897ba87eb...5b75ef2077432c55356ca3f9b723b6e4c54e7b3b
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][master] 2 commits: Consider /etc/mailman3/mailman.cfg as config file

2017-09-28 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch master at mailman / Mailman Core


Commits:
91ea4c2c by Jonas Meurer at 2017-09-28T16:37:52+00:00
Consider /etc/mailman3/mailman.cfg as config file

- - - - -
d6619577 by Barry Warsaw at 2017-09-28T16:37:53+00:00
Merge branch etc_mailman3_mailman.cfg into master

Consider /etc/mailman3/mailman.cfg as config file

Closes #399

See merge request mailman/mailman!319
- - - - -


4 changed files:

- src/mailman/config/docs/config.rst
- src/mailman/core/initialize.py
- src/mailman/docs/NEWS.rst
- src/mailman/tests/test_configfile.py


Changes:

=
src/mailman/config/docs/config.rst
=
--- a/src/mailman/config/docs/config.rst
+++ b/src/mailman/config/docs/config.rst
@@ -19,6 +19,7 @@ site's custom ``mailman.cfg`` file.  The first file found is 
used.
 * ``var/etc/mailman.cfg`` relative to the current working directory
 * ``$HOME/.mailman.cfg``
 * ``/etc/mailman.cfg``
+* ``/etc/mailman3/mailman.cfg``
 * ``../../etc/mailman.cfg`` relative to the working directory of ``argv[0]``
 
 You can also use the ``-C`` option to specify an explicit path, and this


=
src/mailman/core/initialize.py
=
--- a/src/mailman/core/initialize.py
+++ b/src/mailman/core/initialize.py
@@ -71,6 +71,10 @@ def search_for_configuration_file():
 config_path = '/etc/mailman.cfg'
 if os.path.exists(config_path):
 return os.path.abspath(config_path)
+# /etc/mailman3/mailman.cfg
+config_path = '/etc/mailman3/mailman.cfg'
+if os.path.exists(config_path):
+return os.path.abspath(config_path)
 # $argv0/../../etc/mailman.cfg
 bindir = os.path.dirname(sys.argv[0])
 parent = os.path.dirname(bindir)


=
src/mailman/docs/NEWS.rst
=
--- a/src/mailman/docs/NEWS.rst
+++ b/src/mailman/docs/NEWS.rst
@@ -47,6 +47,8 @@ Configuration
 * A new logger has been added called ``logging.plugins``.
 * The ``[styles]paths`` variable has been removed; you can now specify
   additional styles using the new plugin architecture.
+* Mailman now also searches at ``/etc/mailman3/mailman.cfg`` for the
+  configuration file.
 
 Interfaces
 --


=
src/mailman/tests/test_configfile.py
=
--- a/src/mailman/tests/test_configfile.py
+++ b/src/mailman/tests/test_configfile.py
@@ -171,6 +171,17 @@ class TestConfigFileSearchWithChroot(TestConfigFileBase):
 print('# Fake mailman.cfg file', file=fp)
 self.assertEqual(search_for_configuration_file(), config_file)
 
+def test_etc_mailman3_file(self):
+# Test /etc/mailman3/mailman.cfg
+fake_etc = '/etc/mailman3'
+fake_testdir = self._make_fake(fake_etc)
+config_file = os.path.join(fake_etc, 'mailman.cfg')
+with fakedirs(fake_testdir):
+# Write a mostly empty configuration file.
+with open(os.path.join(fake_testdir, 'mailman.cfg'), 'w') as fp:
+print('# Fake mailman.cfg file', file=fp)
+self.assertEqual(search_for_configuration_file(), config_file)
+
 def test_sibling_directory(self):
 # Test $argv0/../../etc/mailman.cfg
 fake_root = '/usr/local/mm3'



View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/f7759db0861415ff8449d9059229beb27980c96b...d6619577b863170474188e2a904102511ca657cb

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/f7759db0861415ff8449d9059229beb27980c96b...d6619577b863170474188e2a904102511ca657cb
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman] Deleted branch fix-schema-typo

2017-09-28 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw deleted branch fix-schema-typo at mailman / Mailman Core

---

You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][master] 2 commits: There is no smtp-failure log any more.

2017-09-28 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch master at mailman / Mailman Core


Commits:
daf719fd by Barry Warsaw at 2017-09-28T10:38:24-04:00
There is no smtp-failure log any more.

- - - - -
f7759db0 by Barry Warsaw at 2017-09-28T15:21:21+00:00
Merge branch fix-schema-typo into master

There is no smtp-failure log anymore

See merge request mailman/mailman!321
- - - - -


1 changed file:

- src/mailman/config/schema.cfg


Changes:

=
src/mailman/config/schema.cfg
=
--- a/src/mailman/config/schema.cfg
+++ b/src/mailman/config/schema.cfg
@@ -298,8 +298,7 @@ debug: no
 # - mischief--  Various types of hostile activity
 # - plugins --  Plugin logs
 # - runner  --  Runner process start/stops
-# - smtp--  Successful SMTP activity
-# - smtp-failure--  Unsuccessful SMTP activity
+# - smtp--  SMTP activity
 # - subscribe   --  Information about leaves/joins
 # - vette   --  Message vetting information
 format: %(asctime)s (%(process)d) %(message)s



View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/e86e2bd3d9f3130ee3721e359903ea8220048f63...f7759db0861415ff8449d9059229beb27980c96b

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/e86e2bd3d9f3130ee3721e359903ea8220048f63...f7759db0861415ff8449d9059229beb27980c96b
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman] Pushed new branch fix-schema-typo

2017-09-28 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed new branch fix-schema-typo at mailman / Mailman Core

---
View it on GitLab: https://gitlab.com/mailman/mailman/tree/fix-schema-typo
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][master] 2 commits: Add an admonition about requiring a UTF-8 locale.

2017-09-06 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch master at mailman / Mailman Core


Commits:
03d2b83a by Barry Warsaw at 2017-09-06T18:56:39-07:00
Add an admonition about requiring a UTF-8 locale.

- - - - -
b3eb9dd4 by Barry Warsaw at 2017-09-07T02:25:59+00:00
Merge branch click-utf8 into master

Add an admonition about requiring a UTF-8 locale

See merge request !316
- - - - -


1 changed file:

- src/mailman/docs/install.rst


Changes:

=
src/mailman/docs/install.rst
=
--- a/src/mailman/docs/install.rst
+++ b/src/mailman/docs/install.rst
@@ -1,6 +1,6 @@
-==
- Installing Mailman 3
-==
+==
+ Installing and running Mailman 3
+==
 
 Copyright (C) 2008-2017 by the Free Software Foundation, Inc.
 
@@ -8,12 +8,12 @@ Copyright (C) 2008-2017 by the Free Software Foundation, Inc.
 Requirements
 
 
-For the Core, Python 3.4 or newer is required.  It can either be the default
-'python3' on your ``$PATH`` or it can be accessible via the ``python3.4``,
-``python3.5``, or ``python3.6`` binary.  If your operating system does not
-include Python 3, see http://www.python.org for information about downloading
-installers (where available) and installing it from source (when necessary or
-preferred).  Python 2 is not supported by the Core.
+For the Core, Python 3.5 or newer is required.  It can either be the default
+'python3' on your ``$PATH`` or it can be accessible via the ``python3.5`` or
+``python3.6`` binary.  If your operating system does not include Python 3, see
+http://www.python.org for information about downloading installers (where
+available) and installing it from source (when necessary or preferred).
+Python 2 is not supported by the Core.
 
 You may need some additional dependencies, which are either available from
 your OS vendor, or can be downloaded automatically from the `Python
@@ -48,6 +48,17 @@ or if you have a GitLab account and prefer ssh::
 Running Mailman 3
 =
 
+.. ATTENTION::
+   The Mailman command line interface requires a properly configured UTF-8
+   locale.  This is because the Core is implemented in `Python 3 and uses the
+   click`_ command line argument parsing library.  Generally this will not be
+   an issue since your shell is probably set up correctly.  However, in
+   certain environments such as init scripts and cron scripts, your locale may
+   not be UTF-8 compatible.  This can cause Mailman to mysteriously fail to
+   run (since often, proper logging may also not be set up).  If you're seeing
+   weird behavior in these types of environments, be sure they are UTF-8
+   compatible, e.g. by setting ``export LANG=en_US.UTF-8``.
+
 You will need to set up a configuration file to override the defaults and set
 things up for your environment.  Mailman is configured using an "ini"-style
 configuration system.  Usually this means creating a ``mailman.cfg`` file and
@@ -103,3 +114,4 @@ do::
 .. _`Mailman 3 Core documentation`: https://mailman.readthedocs.io
 .. _`Zope Component Architecture`: https://pypi.python.org/pypi/zope.component
 .. _`building out the mailman3.org`: 
https://wiki.list.org/DOC/Mailman%203%20installation%20experience
+.. _`Python 3 and uses the click`: http://click.pocoo.org/6/python3/



View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/dd8071a24562477e006952f22e61aa70658b25a7...b3eb9dd428b47232ee50db1f897e128480d6b4c4

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/dd8071a24562477e006952f22e61aa70658b25a7...b3eb9dd428b47232ee50db1f897e128480d6b4c4
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman] Pushed new branch click-utf8

2017-09-06 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed new branch click-utf8 at mailman / Mailman Core

---
View it on GitLab: https://gitlab.com/mailman/mailman/tree/click-utf8
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][coverage] 10 commits: Print the list of available commands with `mailman --help`

2017-09-02 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch coverage at mailman / Mailman Core


Commits:
a5006222 by Abhilash Raj at 2017-08-09T20:45:54-07:00
Print the list of available commands with `mailman --help`

Overriding the format_options method of click.MultiCommand skips printing the
list of available commands. This commit just brings that option back so that
help text is now more informative.

- - - - -
f847e154 by Barry Warsaw at 2017-08-26T14:38:33-04:00
Add a test.

- - - - -
ae0042a9 by Barry Warsaw at 2017-08-29T14:07:54+00:00
PR288 vetted

- - - - -
de8c204f by Barry Warsaw at 2017-08-29T14:07:55+00:00
Add a new plugin architecture.

This allows third parties to add initialization hooks, REST endpoints, 
and additional components.  Given by Jan Jancar.

- - - - -
057bc070 by Barry Warsaw at 2017-08-29T22:51:58-04:00
Squashed commit of the following:

commit 3c6500c2292869f94667520f16c8d6c6f1d2c530
Author: Barry Warsaw ba...@python.org
Date:   Tue Aug 29 22:51:18 2017 -0400

Close #383

Messages with badly encoded ``Subject`` headers no longer crash the message
moderation REST API.

commit f6040ec139bcccd48cfa9acc734cd528a8ede35c
Author: Aurélien Bompard aurel...@bompard.org
Date:   Thu Jul 27 00:52:05 2017 +0200

Fix #383: email encoding errors can crash the REST API

- - - - -
c1060c9d by J08nY at 2017-08-30T13:11:24+02:00
Instantiate components only in add_components, not at lower levels.

 - The scan_module and find_components functions are also useful
   when they dont instantiate the components they load, and
   instantiation is left to add_components.

- - - - -
a7c82290 by Barry Warsaw at 2017-08-30T13:48:04+00:00
Merge branch modules-no-instantiate into master

Instantiate components only in add_components, not at lower levels.

See merge request !300
- - - - -
ab6334ac by Barry Warsaw at 2017-08-30T21:29:06-04:00
Fix runner started/exiting log messages.

Closes #393

- - - - -
fda6c2aa by Barry Warsaw at 2017-09-02T17:42:18+00:00
Merge branch issue393 into master

Fix runner started/exiting log messages

Closes #393

See merge request !311
- - - - -
dc38d0e9 by Barry Warsaw at 2017-09-02T13:52:46-04:00
Merge branch master into coverage

- - - - -


30 changed files:

- README.rst
- src/mailman/app/commands.py
- − src/mailman/app/docs/hooks.rst
- src/mailman/bin/mailman.py
- src/mailman/bin/master.py
- src/mailman/bin/runner.py
- src/mailman/bin/tests/test_mailman.py
- src/mailman/commands/cli_withlist.py
- src/mailman/commands/docs/conf.rst
- src/mailman/commands/docs/info.rst
- src/mailman/commands/tests/test_cli_shell.py
- src/mailman/config/config.py
- src/mailman/config/schema.cfg
- src/mailman/core/chains.py
- src/mailman/core/initialize.py
- src/mailman/core/pipelines.py
- src/mailman/core/rules.py
- src/mailman/docs/NEWS.rst
- + src/mailman/interfaces/plugin.py
- src/mailman/model/docs/listmanager.rst
- + src/mailman/plugins/__init__.py
- + src/mailman/plugins/docs/__init__.py
- + src/mailman/plugins/docs/intro.rst
- + src/mailman/plugins/initialize.py
- + src/mailman/plugins/testing/__init__.py
- + src/mailman/plugins/testing/alternate.cfg
- + src/mailman/plugins/testing/alternate/__init__.py
- + src/mailman/plugins/testing/alternate/rules/__init__.py
- + src/mailman/plugins/testing/alternate/rules/rules.py
- + src/mailman/plugins/testing/example/__init__.py


The diff was not included because it is too large.


View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/efdab8e6d2462d0cd3a916f39f2a6e82eb657090...dc38d0e9facf04bac87038a04189f6392977ae37

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/efdab8e6d2462d0cd3a916f39f2a6e82eb657090...dc38d0e9facf04bac87038a04189f6392977ae37
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][master] 2 commits: Fix runner started/exiting log messages.

2017-09-02 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch master at mailman / Mailman Core


Commits:
ab6334ac by Barry Warsaw at 2017-08-30T21:29:06-04:00
Fix runner started/exiting log messages.

Closes #393

- - - - -
fda6c2aa by Barry Warsaw at 2017-09-02T17:42:18+00:00
Merge branch issue393 into master

Fix runner started/exiting log messages

Closes #393

See merge request !311
- - - - -


1 changed file:

- src/mailman/bin/runner.py


Changes:

=
src/mailman/bin/runner.py
=
--- a/src/mailman/bin/runner.py
+++ b/src/mailman/bin/runner.py
@@ -184,7 +184,7 @@ def main(ctx, config_file, verbose, list_runners, once, 
runner_spec):
 runner = make_runner(*runner_spec, once=once)
 runner.set_signals()
 # Now start up the main loop
-log.info('%s runner started.'.format(runner.name))
+log.info('{} runner started.'.format(runner.name))
 runner.run()
-log.info('%s runner exiting.'.format(runner.name))
+log.info('{} runner exiting.'.format(runner.name))
 sys.exit(runner.status)



View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/a7c82290f87554e07481eb048445e2587ad3bf9a...fda6c2aa5d91d10d19d6da2eff0c73f60c36037a

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/a7c82290f87554e07481eb048445e2587ad3bf9a...fda6c2aa5d91d10d19d6da2eff0c73f60c36037a
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman] Deleted branch 393-runners-log-s-instead-of-name

2017-09-02 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw deleted branch 393-runners-log-s-instead-of-name at mailman / 
Mailman Core

---

You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman] Pushed new branch issue393

2017-08-30 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed new branch issue393 at mailman / Mailman Core

---
View it on GitLab: https://gitlab.com/mailman/mailman/tree/issue393
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][master] 2 commits: Instantiate components only in add_components, not at lower levels.

2017-08-30 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch master at mailman / Mailman Core


Commits:
c1060c9d by J08nY at 2017-08-30T13:11:24+02:00
Instantiate components only in add_components, not at lower levels.

 - The scan_module and find_components functions are also useful
   when they dont instantiate the components they load, and
   instantiation is left to add_components.

- - - - -
a7c82290 by Barry Warsaw at 2017-08-30T13:48:04+00:00
Merge branch modules-no-instantiate into master

Instantiate components only in add_components, not at lower levels.

See merge request !300
- - - - -


2 changed files:

- src/mailman/utilities/modules.py
- src/mailman/utilities/tests/test_modules.py


Changes:

=
src/mailman/utilities/modules.py
=
--- a/src/mailman/utilities/modules.py
+++ b/src/mailman/utilities/modules.py
@@ -97,19 +97,18 @@ def hacked_sys_modules(name, module):
 
 
 def scan_module(module, interface):
-"""Return all the object in a module that conform to an interface.
+"""Return all the items in a module that conform to an interface.
 
 Scan every item named in the module's `__all__`.  If that item conforms to
 the given interface, *and* the item is not declared as an
-`@abstract_component`, then instantiate the item and return the resulting
-instance.
+`@abstract_component`, then return the item.
 
 :param module: A module object.
 :type module: module
 :param interface: The interface that returned objects must conform to.
 :type interface: `Interface`
-:return: The sequence of instantiated matching components.
-:rtype: instantiated objects implementing `interface`
+:return: The sequence of matching components.
+:rtype: items implementing `interface`
 """
 missing = object()
 for name in module.__all__:
@@ -125,22 +124,22 @@ def scan_module(module, interface):
 # where the marker has been placed.  The value of
 # __abstract_component__ doesn't matter, only its presence.
 and '__abstract_component__' not in component.__dict__):
-yield component()
+yield component
 
 
 def find_components(package, interface):
 """Find components which conform to a given interface.
 
 Search all the modules in a given package, returning an iterator over all
-objects found that conform to the given interface, unless that object is
+items found that conform to the given interface, unless that object is
 decorated with `@abstract_component`.
 
 :param package: The package path to search.
 :type package: string
 :param interface: The interface that returned objects must conform to.
 :type interface: `Interface`
-:return: The sequence of instantiated matching components.
-:rtype: instantiated objects implementing `interface`
+:return: The sequence of matching components.
+:rtype: items implementing `interface`
 """
 for filename in resource_listdir(package, ''):
 basename, extension = os.path.splitext(filename)
@@ -198,9 +197,9 @@ def add_components(subpackage, interface, mapping):
 in the given subpackage, relative to the 'mailman' parent package,
 and all the plugin names, that match the given interface.  All such
 found objects (unless decorated with `@abstract_component`) are
-added to the given mapping, keyed by the object's `.name` attribute,
-which is required.  It is a fatal error if that key already exists
-in the mapping.
+instantiated and added to the given mapping, keyed by the object's `.name`
+attribute, which is required.  It is a fatal error if that key already
+exists in the mapping.
 
 :param subpackage: The subpackage path to search.
 :type subpackage: str
@@ -213,7 +212,8 @@ def add_components(subpackage, interface, mapping):
 containment tests (e.g. `in` and `not in`) and `__setitem__()`.
 :raises RuntimeError: when a duplicate key is found.
 """
-for component in find_pluggable_components(subpackage, interface):
+for component_class in find_pluggable_components(subpackage, interface):
+component = component_class()
 if component.name in mapping:
 raise RuntimeError( # pragma: nocover
 'Duplicate key "{}" found in {}; previously {}'.format(


=
src/mailman/utilities/tests/test_modules.py
=
--- a/src/mailman/utilities/tests/test_modules.py
+++ b/src/mailman/utilities/tests/test_modules.py
@@ -105,8 +105,8 @@ class BadStyle:
  in find_components('mypackage', IStyle)]
 self.assertEqual(names, ['good-style'])
 
-def test_find_components_no_instantiate(self):
-# find_components() now instantiates the class unless it's been
+def test_find_components_abstract_component(self):
+# find_components() finds the 

[Mailman-checkins] [Git][mailman/mailman][master] Squashed commit of the following:

2017-08-29 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch master at mailman / Mailman Core


Commits:
057bc070 by Barry Warsaw at 2017-08-29T22:51:58-04:00
Squashed commit of the following:

commit 3c6500c2292869f94667520f16c8d6c6f1d2c530
Author: Barry Warsaw ba...@python.org
Date:   Tue Aug 29 22:51:18 2017 -0400

Close #383

Messages with badly encoded ``Subject`` headers no longer crash the message
moderation REST API.

commit f6040ec139bcccd48cfa9acc734cd528a8ede35c
Author: Aurélien Bompard aurel...@bompard.org
Date:   Thu Jul 27 00:52:05 2017 +0200

Fix #383: email encoding errors can crash the REST API

- - - - -


3 changed files:

- src/mailman/docs/NEWS.rst
- src/mailman/rest/post_moderation.py
- src/mailman/rest/tests/test_moderation.py


Changes:

=
src/mailman/docs/NEWS.rst
=
--- a/src/mailman/docs/NEWS.rst
+++ b/src/mailman/docs/NEWS.rst
@@ -24,6 +24,8 @@ Bugs
 * Various message holds and rejects that gave 'N/A' as a reason now give an
   appropriate reason.  (Closes #368)
 * Bounce messages are now composed for proper translations.
+* Messages with badly encoded ``Subject`` headers no longer crash the message
+  moderation REST API.  (Closes #383)
 
 Command line
 


=
src/mailman/rest/post_moderation.py
=
--- a/src/mailman/rest/post_moderation.py
+++ b/src/mailman/rest/post_moderation.py
@@ -95,7 +95,7 @@ class _HeldMessageBase(_ModerationBase):
 # Store the original header and then try decoding it.
 resource['original_subject'] = resource['subject']
 # If we can't decode the header, leave the subject unchanged.
-with suppress(LookupError, MessageError):
+with suppress(LookupError, MessageError, UnicodeDecodeError):
 resource['subject'] = str(
 make_header(decode_header(resource['subject'])))
 # Also, held message resources will always be this type, so ignore


=
src/mailman/rest/tests/test_moderation.py
=
--- a/src/mailman/rest/tests/test_moderation.py
+++ b/src/mailman/rest/tests/test_moderation.py
@@ -144,6 +144,25 @@ Something else.
  dict(action='discard'))
 self.assertEqual(cm.exception.code, 404)
 
+def test_subject_encoding_error(self):
+# GL#383: messages with badly encoded Subject headers crash the REST
+# server.
+self._msg = mfs("""\
+From: a...@example.com
+To: a...@example.com
+Subject: =?GB2312?B?saa9o7fmtNPEpbVaQ2h1o6zDt7uoz+PX1L/guq7AtKGj?=
+Message-ID: 
+
+Something else.
+""")
+with transaction():
+held_id = hold_message(self._mlist, self._msg)
+json, response = call_api(
+'http://localhost:9001/3.0/lists/a...@example.com/held')
+self.assertEqual(response.status_code, 200)
+self.assertEqual(json['total_size'], 1)
+self.assertEqual(json['entries'][0]['request_id'], held_id)
+
 
 class TestSubscriptionModeration(unittest.TestCase):
 layer = RESTLayer



View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/057bc0704ab6d975e327c11cac204decfb478c4d

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/057bc0704ab6d975e327c11cac204decfb478c4d
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman] Deleted branch testing-gitlab

2017-08-29 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw deleted branch testing-gitlab at mailman / Mailman Core

---

You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman] Deleted branch pr288-vetted

2017-08-29 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw deleted branch pr288-vetted at mailman / Mailman Core

---

You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][master] 2 commits: PR288 vetted

2017-08-29 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch master at mailman / Mailman Core


Commits:
ae0042a9 by Barry Warsaw at 2017-08-29T14:07:54+00:00
PR288 vetted

- - - - -
de8c204f by Barry Warsaw at 2017-08-29T14:07:55+00:00
Add a new plugin architecture.

This allows third parties to add initialization hooks, REST endpoints, 
and additional components.  Given by Jan Jancar.

- - - - -


30 changed files:

- README.rst
- src/mailman/app/commands.py
- − src/mailman/app/docs/hooks.rst
- src/mailman/bin/mailman.py
- src/mailman/bin/master.py
- src/mailman/bin/runner.py
- src/mailman/bin/tests/test_mailman.py
- src/mailman/commands/cli_withlist.py
- src/mailman/commands/docs/conf.rst
- src/mailman/commands/docs/info.rst
- src/mailman/commands/tests/test_cli_shell.py
- src/mailman/config/config.py
- src/mailman/config/schema.cfg
- src/mailman/core/chains.py
- src/mailman/core/initialize.py
- src/mailman/core/pipelines.py
- src/mailman/core/rules.py
- src/mailman/docs/NEWS.rst
- + src/mailman/interfaces/plugin.py
- src/mailman/model/docs/listmanager.rst
- + src/mailman/plugins/__init__.py
- + src/mailman/plugins/docs/__init__.py
- + src/mailman/plugins/docs/intro.rst
- + src/mailman/plugins/initialize.py
- + src/mailman/plugins/testing/__init__.py
- + src/mailman/plugins/testing/alternate.cfg
- + src/mailman/plugins/testing/alternate/__init__.py
- + src/mailman/plugins/testing/alternate/rules/__init__.py
- + src/mailman/plugins/testing/alternate/rules/rules.py
- + src/mailman/plugins/testing/example/__init__.py


The diff was not included because it is too large.


View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/f847e15407bfbf824236547bdf728a1ae00bd405...de8c204fa40f0c4677a1b73b2ee7e3e86ce93a9c

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/f847e15407bfbf824236547bdf728a1ae00bd405...de8c204fa40f0c4677a1b73b2ee7e3e86ce93a9c
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][pr288-vetted] More news.

2017-08-27 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch pr288-vetted at mailman / Mailman Core


Commits:
3e45f14b by Barry Warsaw at 2017-08-27T23:45:35-04:00
More news.

- - - - -


1 changed file:

- src/mailman/docs/NEWS.rst


Changes:

=
src/mailman/docs/NEWS.rst
=
--- a/src/mailman/docs/NEWS.rst
+++ b/src/mailman/docs/NEWS.rst
@@ -32,8 +32,20 @@ Command line
   "fqdn list name" (i.e. the posting address of a mailing list), now also
   accept a ``List-ID``.  Every attempt has been made to keep the CLI backward
   compatible, but there may be subtle differences.  (Closes #346)
+* If no listname is given, running ``mailman withlist -r`` must name a
+  function taking no arguments.  This can be used to introspect Mailman
+  outside of the context of a mailing list.
 * Fix ``mailman withlist`` command parsing.  (Closes #319)
 
+Configuration
+-
+* The ``[mailman]pre_hook`` and ``[mailman]post_hook`` variables are
+  deprecated.  They can still be specified but they will not be run.
+* The ``[paths.*]ext_dir`` variable has been removed.
+* A new logger has been added called ``logging.plugins``.
+* The ``[styles]paths`` variable has been removed; you can now specify
+  additional styles using the new plugin architecture.
+
 Interfaces
 --
 * Broaden the semantics for ``IListManager.get()``.  This API now accepts



View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/3e45f14ba021426025ddaa000a606f3c8cb3df74

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/3e45f14ba021426025ddaa000a606f3c8cb3df74
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][pr288-vetted] NEWS

2017-08-27 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch pr288-vetted at mailman / Mailman Core


Commits:
b088e05c by Barry Warsaw at 2017-08-27T17:16:47-04:00
NEWS

- - - - -


1 changed file:

- src/mailman/docs/NEWS.rst


Changes:

=
src/mailman/docs/NEWS.rst
=
--- a/src/mailman/docs/NEWS.rst
+++ b/src/mailman/docs/NEWS.rst
@@ -46,7 +46,8 @@ Interfaces
 Other
 -
 * Add a new plugin architecture, which allows third parties to add
-  initialization hooks and REST endpoints.
+  initialization hooks, REST endpoints, and additional components.  Given by
+  Jan Jancar.
 * Drop support for Python 3.4.  (Closes #373)
 * Bump minimum requirements for aiosmtpd (>= 1.1) and flufl.lock (>= 3.1).
 



View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/b088e05c1dff5fa7678f82960a58bec0d9f44e4a

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/b088e05c1dff5fa7678f82960a58bec0d9f44e4a
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][pr288-vetted] One last doc cleanup.

2017-08-27 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch pr288-vetted at mailman / Mailman Core


Commits:
3572b11c by Barry Warsaw at 2017-08-27T17:04:57-04:00
One last doc cleanup.

- - - - -


3 changed files:

- src/mailman/plugins/docs/intro.rst
- src/mailman/plugins/testing/hooks.cfg
- src/mailman/plugins/testing/rest.cfg


Changes:

=
src/mailman/plugins/docs/intro.rst
=
--- a/src/mailman/plugins/docs/intro.rst
+++ b/src/mailman/plugins/docs/intro.rst
@@ -5,7 +5,7 @@
 Mailman defines a plugin as a Python package on ``sys.path`` that provides
 components matching the ``IPlugin`` interface.  ``IPlugin`` implementations
 can define a *pre-hook*, a *post-hook*, and a *REST resource*.  Plugins are
-enabled by adding a section to your ``mailman.cfg`` file, such as::
+enabled by adding a section to your ``mailman.cfg`` file, such as:
 
 .. literalinclude:: ../testing/hooks.cfg
 
@@ -35,8 +35,8 @@ Hooks
 
 Plugins can add initialization hooks, which will be run at two stages in the
 initialization process - one before the database is initialized and one after.
-As you can see above, the plugin defines a ``pre_hook()`` method and a
-``post_hook()`` method.  These methods are optional.
+These correspond to methods the plugin defines, a ``pre_hook()`` method and a
+``post_hook()`` method.  Each of these methods are optional.
 
 Here is a plugin that defines these hooks:
 
@@ -72,7 +72,7 @@ this::
 __init__.py
 rules.py
 
-And the contents of ``rules.py`` looks like::
+And the contents of ``rules.py`` looks like:
 
 .. literalinclude:: ../testing/example/rules/rules.py
 
@@ -104,13 +104,12 @@ We use this configuration file and the following file 
system layout::
 __init__.py
 rules.py
 
-Here, ``rules.py`` likes like::
+Here, ``rules.py`` likes like:
 
 .. literalinclude:: ../testing/alternate/rules/rules.py
 
 You can see that this rule has a different name.  If we use the
-``alternate.cfg`` configuration file
-::
+``alternate.cfg`` configuration file from above::
 
 >>> config_file = resource_filename(
 ... 'mailman.plugins.testing', 'alternate.cfg')
@@ -137,8 +136,6 @@ which we can enable with the following configuration file:
 
 .. literalinclude:: ../testing/rest.cfg
 
-We have this configuration file handy.
-
 The plugin defines a ``resource`` attribute that exposes the root of the
 plugin's resource tree.  The plugin will show up when we navigate to the
 ``plugin`` resource.


=
src/mailman/plugins/testing/hooks.cfg
=
--- a/src/mailman/plugins/testing/hooks.cfg
+++ b/src/mailman/plugins/testing/hooks.cfg
@@ -1,6 +1,3 @@
 [plugin.example]
 class: example.hooks.ExamplePlugin
 enabled: yes
-
-[logging.plugins]
-propagate: yes


=
src/mailman/plugins/testing/rest.cfg
=
--- a/src/mailman/plugins/testing/rest.cfg
+++ b/src/mailman/plugins/testing/rest.cfg
@@ -2,13 +2,5 @@
 class: example.rest.ExamplePlugin
 enabled: yes
 
-[logging.plugins]
-level: debug
-propagate: yes
-
-[logging.http]
-level: debug
-propagate: yes
-
 [webservice]
 port: 9001



View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/3572b11c2d42de0fa749786d35df5e660b21c4b3

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/3572b11c2d42de0fa749786d35df5e660b21c4b3
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][master] 2 commits: Print the list of available commands with `mailman --help`

2017-08-26 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch master at mailman / Mailman Core


Commits:
a5006222 by Abhilash Raj at 2017-08-09T20:45:54-07:00
Print the list of available commands with `mailman --help`

Overriding the format_options method of click.MultiCommand skips printing the
list of available commands. This commit just brings that option back so that
help text is now more informative.

- - - - -
f847e154 by Barry Warsaw at 2017-08-26T14:38:33-04:00
Add a test.

- - - - -


2 changed files:

- src/mailman/bin/mailman.py
- src/mailman/bin/tests/test_mailman.py


Changes:

=
src/mailman/bin/mailman.py
=
--- a/src/mailman/bin/mailman.py
+++ b/src/mailman/bin/mailman.py
@@ -81,6 +81,8 @@ class Subcommands(click.MultiCommand):
 if opts:
 with formatter.section('Options'):
 formatter.write_dl(opts)
+# Print the list of available commands.
+super().format_commands(ctx, formatter)
 
 
 @click.group(


=
src/mailman/bin/tests/test_mailman.py
=
--- a/src/mailman/bin/tests/test_mailman.py
+++ b/src/mailman/bin/tests/test_mailman.py
@@ -25,8 +25,10 @@ from mailman.app.lifecycle import create_list
 from mailman.bin.mailman import main
 from mailman.config import config
 from mailman.database.transaction import transaction
+from mailman.interfaces.command import ICLISubCommand
 from mailman.testing.layers import ConfigLayer
 from mailman.utilities.datetime import now
+from mailman.utilities.modules import add_components
 from unittest.mock import patch
 
 
@@ -45,6 +47,14 @@ class TestMailmanCommand(unittest.TestCase):
 # works.  It does actually show the correct program when run from the
 # command line.
 self.assertEqual(lines[0], 'Usage: main [OPTIONS] COMMAND [ARGS]...')
+# The help output includes a list of subcommands, in sorted order.
+commands = {}
+add_components('mailman.commands', ICLISubCommand, commands)
+help_commands = list(
+line.split()[0].strip()
+for line in lines[-len(commands):]
+)
+self.assertEqual(sorted(commands), help_commands)
 
 def test_mailman_command_with_bad_subcommand_prints_help(self):
 # Issue #137: Running `mailman` without a subcommand raises an



View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/324226f1f859f6be5e932dc9abe638aba268d154...f847e15407bfbf824236547bdf728a1ae00bd405

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/324226f1f859f6be5e932dc9abe638aba268d154...f847e15407bfbf824236547bdf728a1ae00bd405
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][coverage] 18 commits: Set a timeout on the lock acquisition

2017-08-03 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch coverage at mailman / Mailman Core


Commits:
d1cbc8af by Barry Warsaw at 2017-07-27T23:10:42+00:00
Set a timeout on the lock acquisition

- - - - -
e6326533 by Barry Warsaw at 2017-07-27T23:10:42+00:00
Merge branch fix-hangs into master

Set a timeout on the lock acquisition

See merge request !305
- - - - -
9cdcffbc by Barry Warsaw at 2017-08-04T01:13:04+00:00
Rename metadata key for clarity

- - - - -
324226f1 by Barry Warsaw at 2017-08-04T01:13:04+00:00
Merge branch rename-metadata-key into master

Rename metadata key for clarity
Compose bounce messages so that they can be properly translated

See merge request !304
- - - - -
3413bc7a by Barry Warsaw at 2017-08-03T21:24:18-04:00
Boost lifecycle.py coverage to 100%

- - - - -
1a4009cf by Barry Warsaw at 2017-08-03T21:24:18-04:00
Boost workflow.py coverage to 100%

- - - - -
3df609fb by Barry Warsaw at 2017-08-03T21:24:18-04:00
Boost coverage.

- - - - -
b47f7c8d by Barry Warsaw at 2017-08-03T21:24:18-04:00
Boost coverage.

- - - - -
1c888e78 by Barry Warsaw at 2017-08-03T21:24:18-04:00
Boost coverage.

- - - - -
25601a90 by Barry Warsaw at 2017-08-03T21:24:18-04:00
Increase the coverage minimum.

- - - - -
978f4b5d by Barry Warsaw at 2017-08-03T21:24:49-04:00
Boost coverage and modernize.

- - - - -
35284568 by Barry Warsaw at 2017-08-03T21:24:49-04:00
Boost coverage.

- - - - -
05feb132 by Barry Warsaw at 2017-08-03T21:24:49-04:00
Boost coverage.

Also:

* Validate bans as email addresses.
* Fix PATCH on nonexistent domains.

- - - - -
f426872c by Barry Warsaw at 2017-08-03T21:24:49-04:00
Boost coverage.

- - - - -
b19f3a81 by Barry Warsaw at 2017-08-03T21:24:49-04:00
Boost coverage to 95%

- - - - -
68f8eced by Barry Warsaw at 2017-08-03T21:24:49-04:00
Boost coverage.

- - - - -
f466a3d4 by Barry Warsaw at 2017-08-03T21:24:49-04:00
Boost coverage.

- - - - -
efdab8e6 by Barry Warsaw at 2017-08-03T21:30:23-04:00
Cover interfaces 100%

- - - - -


30 changed files:

- src/mailman/app/bounces.py
- src/mailman/app/docs/bounces.rst
- src/mailman/app/tests/test_lifecycle.py
- src/mailman/app/tests/test_workflow.py
- src/mailman/chains/base.py
- src/mailman/chains/builtin.py
- + src/mailman/chains/dmarc.py
- src/mailman/chains/hold.py
- src/mailman/chains/moderation.py
- src/mailman/chains/reject.py
- src/mailman/chains/tests/test_accept.py
- + src/mailman/chains/tests/test_dmarc.py
- src/mailman/commands/cli_withlist.py
- src/mailman/commands/docs/status.rst
- src/mailman/core/i18n.py
- src/mailman/core/pipelines.py
- src/mailman/core/tests/test_pipelines.py
- src/mailman/docs/NEWS.rst
- src/mailman/handlers/tests/test_mimedel.py
- src/mailman/interfaces/pipeline.py
- src/mailman/interfaces/subscriptions.py
- src/mailman/interfaces/template.py
- src/mailman/model/tests/test_subscriptions.py
- src/mailman/mta/deliver.py
- src/mailman/rest/bans.py
- src/mailman/rest/domains.py
- src/mailman/rest/listconf.py
- src/mailman/rest/lists.py
- src/mailman/rest/preferences.py
- src/mailman/rest/root.py


The diff was not included because it is too large.


View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/f4768b735f3800de69afd9b6a6b1043a2cbd003b...efdab8e6d2462d0cd3a916f39f2a6e82eb657090

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/f4768b735f3800de69afd9b6a6b1043a2cbd003b...efdab8e6d2462d0cd3a916f39f2a6e82eb657090
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman] Deleted branch rename-metadata-key

2017-08-03 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw deleted branch rename-metadata-key at mailman / Mailman Core

---

You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][rename-metadata-key] Typo

2017-08-03 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch rename-metadata-key at mailman / Mailman Core


Commits:
b3555190 by Barry Warsaw at 2017-08-03T19:33:45-04:00
Typo

- - - - -


1 changed file:

- src/mailman/docs/NEWS.rst


Changes:

=
src/mailman/docs/NEWS.rst
=
--- a/src/mailman/docs/NEWS.rst
+++ b/src/mailman/docs/NEWS.rst
@@ -23,7 +23,7 @@ Bugs
   discarded.  (Closes #369)
 * Various message holds and rejects that gave 'N/A' as a reason now give an
   appropriate reason.  (Closes #368)
-* Bounce messages are now compose for proper translations.
+* Bounce messages are now composed for proper translations.
 
 Command line
 



View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/b3555190ec312fb3d9b027f4dde44619475587d5

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/b3555190ec312fb3d9b027f4dde44619475587d5
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][rename-metadata-key] Add NEWS.

2017-08-03 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch rename-metadata-key at mailman / Mailman Core


Commits:
127194b9 by Barry Warsaw at 2017-08-03T19:17:14-04:00
Add NEWS.

- - - - -


1 changed file:

- src/mailman/docs/NEWS.rst


Changes:

=
src/mailman/docs/NEWS.rst
=
--- a/src/mailman/docs/NEWS.rst
+++ b/src/mailman/docs/NEWS.rst
@@ -23,6 +23,7 @@ Bugs
   discarded.  (Closes #369)
 * Various message holds and rejects that gave 'N/A' as a reason now give an
   appropriate reason.  (Closes #368)
+* Bounce messages are now compose for proper translations.
 
 Command line
 
@@ -39,6 +40,8 @@ Interfaces
   both ``List-ID``s and fully qualified list names, since that's the most
   common use case.  There's now a separate ``.get_by_fqdn()`` which only
   accepts the latter and mirrors the already existing ``.get_by_list_id()``.
+* A new template ``list:user:notice:rejected`` has been added for customizing
+  the bounce message rejection notice.
 
 Other
 -



View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/127194b969f3ef4462807d80b49d4e7c919870f5

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/127194b969f3ef4462807d80b49d4e7c919870f5
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][rename-metadata-key] 100% diffcov.

2017-08-03 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch rename-metadata-key at mailman / Mailman Core


Commits:
8ebd97ee by Barry Warsaw at 2017-08-03T14:09:49-04:00
100% diffcov.

Also, since the str() of the error object will contain the full details, use
it in the log message when the pipeline processor gets a RejectMessage.

- - - - -


3 changed files:

- src/mailman/core/pipelines.py
- src/mailman/core/tests/test_pipelines.py
- src/mailman/interfaces/pipeline.py


Changes:

=
src/mailman/core/pipelines.py
=
--- a/src/mailman/core/pipelines.py
+++ b/src/mailman/core/pipelines.py
@@ -55,7 +55,7 @@ def process(mlist, msg, msgdata, pipeline_name='built-in'):
 except RejectMessage as error:
 vlog.info(
 '{} rejected by "{}" pipeline handler "{}": {}'.format(
-message_id, pipeline_name, handler.name, error.message))
+message_id, pipeline_name, handler.name, str(error)))
 bounce_message(mlist, msg, error)
 
 


=
src/mailman/core/tests/test_pipelines.py
=
--- a/src/mailman/core/tests/test_pipelines.py
+++ b/src/mailman/core/tests/test_pipelines.py
@@ -48,8 +48,11 @@ class DiscardingHandler:
 class RejectHandler:
 name = 'rejecting'
 
+def __init__(self, message):
+self.message = message
+
 def process(self, mlist, msg, msgdata):
-raise RejectMessage('by test handler')
+raise RejectMessage(self.message)
 
 
 @implementer(IPipeline)
@@ -66,8 +69,11 @@ class RejectingPipeline:
 name = 'test-rejecting'
 description = 'Rejectinging test pipeline'
 
+def __init__(self):
+self.message = 'by test handler'
+
 def __iter__(self):
-yield RejectHandler()
+yield RejectHandler(self.message)
 
 
 class TestPostingPipeline(unittest.TestCase):
@@ -109,18 +115,49 @@ testing
 '"discarding": by test handler'))
 
 def test_rejecting_pipeline(self):
-# If a handler in the pipeline raises DiscardMessage, the message will
-# be thrown away, but with a log message.
+# If a handler in the pipeline raises RejectMessage, the post will
+# be bounced with a log message.
 mark = LogFileMark('mailman.vette')
 process(self._mlist, self._msg, {}, 'test-rejecting')
 line = mark.readline()[:-1]
-self.assertTrue(line.endswith(
+self.assertEqual(
+line[-80:],
+' rejected by "test-rejecting" pipeline handler '
+'"rejecting": by test handler',
+line)
+# In the rejection case, the original message will also be in the
+# virgin queue.
+items = get_queue_messages('virgin', expected_count=1)
+self.assertEqual(
+str(items[0].msg.get_payload(1).get_payload(0)['subject']),
+'a test')
+# The first payload contains the rejection reason.
+payload = items[0].msg.get_payload(0).get_payload()
+self.assertEqual(payload, 'by test handler')
+
+def test_rejecting_pipeline_without_message(self):
+# Similar to above, but without a rejection message.
+pipeline = config.pipelines['test-rejecting']
+message = pipeline.message
+self.addCleanup(setattr, pipeline, 'message', message)
+pipeline.message = None
+mark = LogFileMark('mailman.vette')
+process(self._mlist, self._msg, {}, 'test-rejecting')
+line = mark.readline()[:-1]
+self.assertEqual(
+line[-91:],
 ' rejected by "test-rejecting" pipeline handler '
-'"rejecting": by test handler'))
+'"rejecting": [No details are available]',
+line)
 # In the rejection case, the original message will also be in the
 # virgin queue.
 items = get_queue_messages('virgin', expected_count=1)
-self.assertEqual(str(items[0].msg['subject']), 'a test')
+self.assertEqual(
+str(items[0].msg.get_payload(1).get_payload(0)['subject']),
+'a test')
+# The first payload contains the rejection reason.
+payload = items[0].msg.get_payload(0).get_payload()
+self.assertEqual(payload, '[No details are available]')
 
 def test_decorate_bulk(self):
 # Ensure that bulk postings get decorated with the footer.


=
src/mailman/interfaces/pipeline.py
=
--- a/src/mailman/interfaces/pipeline.py
+++ b/src/mailman/interfaces/pipeline.py
@@ -50,7 +50,7 @@ class RejectMessage(BaseException):
 
 def __str__(self):
 if self.message is None:
-return _('[No bounce details are available]')
+return _('[No details are available]')
 reasons = (_('[No reasons given]')
if self.reasons is None
else 

[Mailman-checkins] [Git][mailman/mailman][rename-metadata-key] Adjust for Python 3.5/3.6 differences with flake8.

2017-08-01 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch rename-metadata-key at mailman / Mailman Core


Commits:
15ce97cd by Barry Warsaw at 2017-08-01T11:35:34-04:00
Adjust for Python 3.5/3.6 differences with flake8.

Python 3.5 does not like the spaces after the commas.  This breaks qa
apparently on GL.  Locally, with Python 3.6, the spaces are fine since qa
doesnt complain here.

I wonder why this is happening all of a sudden?  Probably a flake8 bug.  I
suppose this should be reported upstream. :/

- - - - -


2 changed files:

- src/mailman/commands/cli_withlist.py
- src/mailman/mta/deliver.py


Changes:

=
src/mailman/commands/cli_withlist.py
=
--- a/src/mailman/commands/cli_withlist.py
+++ b/src/mailman/commands/cli_withlist.py
@@ -80,7 +80,7 @@ def start_python(overrides, banner):
 # Set the tab completion.
 with ExitStack() as resources:
 try:# pragma: nocover
-import readline, rlcompleter# noqa: F401, E401
+import readline, rlcompleter# noqa: F401,E401
 except ImportError: # pragma: nocover
 print(_('readline not available'), file=sys.stderr)
 pass


=
src/mailman/mta/deliver.py
=
--- a/src/mailman/mta/deliver.py
+++ b/src/mailman/mta/deliver.py
@@ -90,15 +90,15 @@ def deliver(mlist, msg, msgdata):
 if size is None:
 size = len(msg.as_string())
 substitutions = dict(
-msgid   = msg.get('message-id', 'n/a'),   # noqa: E221, E251
-listname= mlist.fqdn_listname,# noqa: E221, E251
-sender  = original_sender,# noqa: E221, E251
-recip   = len(original_recipients),   # noqa: E221, E251
-size= size,   # noqa: E221, E251
-time= t1 - t0,# noqa: E221, E251
-refused = len(refused),   # noqa: E221, E251
-smtpcode= 'n/a',  # noqa: E221, E251
-smtpmsg = 'n/a',  # noqa: E221, E251
+msgid   = msg.get('message-id', 'n/a'),   # noqa: E221,E251
+listname= mlist.fqdn_listname,# noqa: E221,E251
+sender  = original_sender,# noqa: E221,E251
+recip   = len(original_recipients),   # noqa: E221,E251
+size= size,   # noqa: E221,E251
+time= t1 - t0,# noqa: E221,E251
+refused = len(refused),   # noqa: E221,E251
+smtpcode= 'n/a',  # noqa: E221,E251
+smtpmsg = 'n/a',  # noqa: E221,E251
 )
 template = config.logging.smtp.every
 if template.lower() != 'no':
@@ -141,9 +141,9 @@ def deliver(mlist, msg, msgdata):
 template = config.logging.smtp.failure
 if template.lower() != 'no':
 substitutions.update(
-recip   = recipient,# noqa: E221, E251
-smtpcode= code, # noqa: E221, E251
-smtpmsg = smtp_message, # noqa: E221, E251
+recip   = recipient,# noqa: E221,E251
+smtpcode= code, # noqa: E221,E251
+smtpmsg = smtp_message, # noqa: E221,E251
 )
 log.info('%s', expand(template, mlist, substitutions))
 # Return the results



View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/15ce97cd60ac097ec402acd7412a325de1db09bc

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/15ce97cd60ac097ec402acd7412a325de1db09bc
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][rename-metadata-key] 2 commits: Fix flake8.

2017-07-30 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch rename-metadata-key at mailman / Mailman Core


Commits:
b9ef98f2 by Barry Warsaw at 2017-07-30T21:38:15-04:00
Fix flake8.

- - - - -
8ea476a3 by Barry Warsaw at 2017-07-30T21:52:14-04:00
Refactor into a base class.

- - - - -


4 changed files:

- src/mailman/chains/base.py
- src/mailman/chains/dmarc.py
- src/mailman/chains/moderation.py
- src/mailman/chains/tests/test_dmarc.py


Changes:

=
src/mailman/chains/base.py
=
--- a/src/mailman/chains/base.py
+++ b/src/mailman/chains/base.py
@@ -107,6 +107,31 @@ class TerminalChainBase:
 
 @public
 @abstract_component
+@implementer(IChain)
+class JumpChainBase:
+"""A base chain that simplifies jumping to another chain."""
+def jump_to(self, mlist, msg, msgsdata):
+"""Return the chain to jump to.
+
+This must be overridden by subclasses.
+
+:param mlist: The mailing list.
+:param msg: The message.
+:param msgdata: The message metadata.
+:return: The name of the chain to jump to.
+:rtype: str
+"""
+raise NotImplementedError
+
+def get_links(self, mlist, msg, msgdata):
+jump_chain = self.jump_to(mlist, msg, msgdata)
+return iter([
+Link('truth', LinkAction.jump, jump_chain),
+])
+
+
+@public
+@abstract_component
 @implementer(IMutableChain)
 class Chain:
 """Generic chain base class."""


=
src/mailman/chains/dmarc.py
=
--- a/src/mailman/chains/dmarc.py
+++ b/src/mailman/chains/dmarc.py
@@ -17,28 +17,23 @@
 
 """DMARC mitigation chain."""
 
-from mailman.chains.base import Link
+from mailman.chains.base import JumpChainBase
 from mailman.core.i18n import _
-from mailman.interfaces.chain import IChain, LinkAction
 from public import public
-from zope.interface import implementer
 
 
 @public
-@implementer(IChain)
-class DMARCMitigationChain:
+class DMARCMitigationChain(JumpChainBase):
 """Perform DMARC mitigation."""
 
 name = 'dmarc'
 description = _('Process DMARC reject or discard mitigations')
 
-def get_links(self, mlist, msg, msgdata):
+def jump_to(self, mlist, msg, msgdata):
 # Which action should be taken?
 jump_chain = msgdata['dmarc_action']
 assert jump_chain in ('discard', 'reject'), (
 '{}: Invalid DMARC action: {} for sender: {}'.format(
 mlist.list_id, jump_chain,
 msgdata.get('moderation_sender', '(unknown)')))
-return iter([
-Link('truth', LinkAction.jump, jump_chain),
-])
+return jump_chain


=
src/mailman/chains/moderation.py
=
--- a/src/mailman/chains/moderation.py
+++ b/src/mailman/chains/moderation.py
@@ -34,17 +34,14 @@ made as to the disposition of the message.  `defer` is the 
default for
 members, while `hold` is the default for nonmembers.
 """
 
-from mailman.chains.base import Link
+from mailman.chains.base import JumpChainBase
 from mailman.core.i18n import _
 from mailman.interfaces.action import Action
-from mailman.interfaces.chain import IChain, LinkAction
 from public import public
-from zope.interface import implementer
 
 
 @public
-@implementer(IChain)
-class ModerationChain:
+class ModerationChain(JumpChainBase):
 """Dynamically produce a link jumping to the appropriate terminal chain.
 
 The terminal chain will be one of the Accept, Hold, Discard, or Reject
@@ -53,8 +50,7 @@ class ModerationChain:
 name = 'moderation'
 description = _('Moderation chain')
 
-def get_links(self, mlist, msg, msgdata):
-"""See `IChain`."""
+def jump_to(self, mlist, msg, msgdata):
 # Get the moderation action from the message metadata.  It can only be
 # one of the expected values (i.e. not Action.defer).  See the
 # moderation.py rule for details.  This is stored in the metadata as a
@@ -71,6 +67,4 @@ class ModerationChain:
 '{}: Invalid moderation action: {} for sender: {}'.format(
 mlist.list_id, action,
 msgdata.get('moderation_sender', '(unknown)')))
-return iter([
-Link('truth', LinkAction.jump, jump_chain),
-])
+return jump_chain


=
src/mailman/chains/tests/test_dmarc.py
=
--- a/src/mailman/chains/tests/test_dmarc.py
+++ b/src/mailman/chains/tests/test_dmarc.py
@@ -22,10 +22,10 @@ import unittest
 from mailman.app.lifecycle import create_list
 from mailman.core.chains import process as process_chain
 from mailman.interfaces.chain import DiscardEvent, RejectEvent
-from mailman.testing.layers import ConfigLayer
 from mailman.testing.helpers import (
 event_subscribers, get_queue_messages,
 specialized_message_from_string as mfs)

[Mailman-checkins] [Git][mailman/mailman][master] 2 commits: Set a timeout on the lock acquisition

2017-07-27 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch master at mailman / Mailman Core


Commits:
d1cbc8af by Barry Warsaw at 2017-07-27T23:10:42+00:00
Set a timeout on the lock acquisition

- - - - -
e6326533 by Barry Warsaw at 2017-07-27T23:10:42+00:00
Merge branch fix-hangs into master

Set a timeout on the lock acquisition

See merge request !305
- - - - -


1 changed file:

- src/mailman/commands/docs/status.rst


Changes:

=
src/mailman/commands/docs/status.rst
=
--- a/src/mailman/commands/docs/status.rst
+++ b/src/mailman/commands/docs/status.rst
@@ -15,9 +15,10 @@ The status is printed to stdout and a status code is 
returned.
 
 We can simulate the master starting up by acquiring its lock.
 
+>>> from datetime import timedelta
 >>> from flufl.lock import Lock
 >>> lock = Lock(config.LOCK_FILE)
->>> lock.lock()
+>>> lock.lock(timeout=timedelta(seconds=20))
 >>> ignore = cleanups.callback(lock.unlock, unconditionally=True)
 
 Getting the status confirms that the master is running.



View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/ade94e8f833a9472ba9be52a08f4e2f381e7a212...e6326533b78290514ede917ed1cb95804759a45a

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/ade94e8f833a9472ba9be52a08f4e2f381e7a212...e6326533b78290514ede917ed1cb95804759a45a
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman] Deleted branch fix-hangs

2017-07-27 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw deleted branch fix-hangs at mailman / Mailman Core

---

You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][fix-hangs] Remove debugging.

2017-07-27 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch fix-hangs at mailman / Mailman Core


Commits:
70ee9d7a by Barry Warsaw at 2017-07-27T18:37:20-04:00
Remove debugging.

- - - - -


1 changed file:

- src/mailman/bin/master.py


Changes:

=
src/mailman/bin/master.py
=
--- a/src/mailman/bin/master.py
+++ b/src/mailman/bin/master.py
@@ -120,7 +120,6 @@ def acquire_lock_1(force, lock_file=None):
 lock = Lock(lock_file, LOCK_LIFETIME)
 try:
 lock.lock(timedelta(seconds=0.1))
-print('=>', lock.details, file=sys.stderr)
 return lock
 except TimeOutError:
 if not force:
@@ -573,5 +572,4 @@ def main(config_file, restartable, force, runners, verbose):
 loop.cleanup()
 os.remove(config.PID_FILE)
 finally:
-print('<=', lock.details, file=sys.stderr)
 lock.unlock()



View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/70ee9d7aef2a91a15e271327749bd977fc151c8b

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/70ee9d7aef2a91a15e271327749bd977fc151c8b
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][fix-hangs] Debugging!

2017-07-27 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch fix-hangs at mailman / Mailman Core


Commits:
a3150b2b by Barry Warsaw at 2017-07-27T18:10:36-04:00
Debugging!

- - - - -


1 changed file:

- src/mailman/bin/master.py


Changes:

=
src/mailman/bin/master.py
=
--- a/src/mailman/bin/master.py
+++ b/src/mailman/bin/master.py
@@ -120,6 +120,7 @@ def acquire_lock_1(force, lock_file=None):
 lock = Lock(lock_file, LOCK_LIFETIME)
 try:
 lock.lock(timedelta(seconds=0.1))
+print('=>', lock.details, file=sys.stderr)
 return lock
 except TimeOutError:
 if not force:
@@ -572,4 +573,5 @@ def main(config_file, restartable, force, runners, verbose):
 loop.cleanup()
 os.remove(config.PID_FILE)
 finally:
+print('<=', lock.details, file=sys.stderr)
 lock.unlock()



View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/a3150b2bc3baf5b3283685008312bb2cfd0725b4

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/a3150b2bc3baf5b3283685008312bb2cfd0725b4
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][coverage] 16 commits: Ensure all holds/rejects have a reason.

2017-07-26 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch coverage at mailman / Mailman Core


Commits:
bea94cb9 by Mark Sapiro at 2017-07-26T08:11:33-07:00
Ensure all holds/rejects have a reason.

- - - - -
ade94e8f by Barry Warsaw at 2017-07-26T23:24:18+00:00
Ensure that various rules set a reason.

Closes #368

- - - - -
422c7c15 by Barry Warsaw at 2017-07-26T23:48:17-04:00
Boost lifecycle.py coverage to 100%

- - - - -
8a2b4008 by Barry Warsaw at 2017-07-26T23:48:17-04:00
Boost workflow.py coverage to 100%

- - - - -
5a39b408 by Barry Warsaw at 2017-07-26T23:48:17-04:00
Boost coverage.

- - - - -
9e295781 by Barry Warsaw at 2017-07-26T23:48:17-04:00
Boost coverage.

- - - - -
ceb309a4 by Barry Warsaw at 2017-07-26T23:48:17-04:00
Boost coverage.

- - - - -
797eb5e4 by Barry Warsaw at 2017-07-26T23:48:17-04:00
Increase the coverage minimum.

- - - - -
3026f642 by Barry Warsaw at 2017-07-26T23:49:07-04:00
Boost coverage and modernize.

- - - - -
a7eb8b7c by Barry Warsaw at 2017-07-26T23:49:07-04:00
Boost coverage.

- - - - -
879710ed by Barry Warsaw at 2017-07-26T23:49:07-04:00
Boost coverage.

Also:

* Validate bans as email addresses.
* Fix PATCH on nonexistent domains.

- - - - -
bb666cc7 by Barry Warsaw at 2017-07-26T23:49:07-04:00
Boost coverage.

- - - - -
98760955 by Barry Warsaw at 2017-07-26T23:49:07-04:00
Boost coverage to 95%

- - - - -
cc5f99ba by Barry Warsaw at 2017-07-26T23:49:07-04:00
Boost coverage.

- - - - -
074933bd by Barry Warsaw at 2017-07-26T23:49:07-04:00
Boost coverage.

- - - - -
47264314 by Barry Warsaw at 2017-07-26T23:50:24-04:00
Merge branch coverage of gitlab.com:mailman/mailman into coverage

- - - - -


30 changed files:

- setup.py
- src/mailman/chains/base.py
- src/mailman/chains/headers.py
- src/mailman/chains/hold.py
- src/mailman/chains/reject.py
- src/mailman/chains/tests/test_headers.py
- src/mailman/chains/tests/test_hold.py
- src/mailman/chains/tests/test_reject.py
- src/mailman/docs/NEWS.rst
- src/mailman/rules/administrivia.py
- src/mailman/rules/banned_address.py
- src/mailman/rules/dmarc.py
- src/mailman/rules/emergency.py
- src/mailman/rules/implicit_dest.py
- src/mailman/rules/loop.py
- src/mailman/rules/max_recipients.py
- src/mailman/rules/max_size.py
- src/mailman/rules/moderation.py
- src/mailman/rules/news_moderation.py
- src/mailman/rules/no_senders.py
- src/mailman/rules/no_subject.py
- src/mailman/rules/suspicious.py
- + src/mailman/rules/tests/test_administrivia.py
- src/mailman/rules/tests/test_banned_address.py
- + src/mailman/rules/tests/test_emergency.py
- + src/mailman/rules/tests/test_implicit_dest.py
- + src/mailman/rules/tests/test_loop.py
- + src/mailman/rules/tests/test_max_recipients.py
- + src/mailman/rules/tests/test_max_size.py
- + src/mailman/rules/tests/test_news_moderation.py


The diff was not included because it is too large.


View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/8fbcf37a3d9837799f3bb18e5e4395caf60bf44f...472643144435103e5cd57d1e35e52bc9a7bc6d96

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/8fbcf37a3d9837799f3bb18e5e4395caf60bf44f...472643144435103e5cd57d1e35e52bc9a7bc6d96
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman] Pushed new branch rename-metadata-key

2017-07-26 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed new branch rename-metadata-key at mailman / Mailman Core

---
View it on GitLab: https://gitlab.com/mailman/mailman/tree/rename-metadata-key
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][master] 2 commits: Ensure all holds/rejects have a reason.

2017-07-26 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch master at mailman / Mailman Core


Commits:
bea94cb9 by Mark Sapiro at 2017-07-26T08:11:33-07:00
Ensure all holds/rejects have a reason.

- - - - -
ade94e8f by Barry Warsaw at 2017-07-26T23:24:18+00:00
Ensure that various rules set a reason.

Closes #368

- - - - -


30 changed files:

- setup.py
- src/mailman/chains/base.py
- src/mailman/chains/headers.py
- src/mailman/chains/hold.py
- src/mailman/chains/reject.py
- src/mailman/chains/tests/test_headers.py
- src/mailman/chains/tests/test_hold.py
- src/mailman/chains/tests/test_reject.py
- src/mailman/docs/NEWS.rst
- src/mailman/rules/administrivia.py
- src/mailman/rules/banned_address.py
- src/mailman/rules/dmarc.py
- src/mailman/rules/emergency.py
- src/mailman/rules/implicit_dest.py
- src/mailman/rules/loop.py
- src/mailman/rules/max_recipients.py
- src/mailman/rules/max_size.py
- src/mailman/rules/moderation.py
- src/mailman/rules/news_moderation.py
- src/mailman/rules/no_senders.py
- src/mailman/rules/no_subject.py
- src/mailman/rules/suspicious.py
- + src/mailman/rules/tests/test_administrivia.py
- src/mailman/rules/tests/test_banned_address.py
- + src/mailman/rules/tests/test_emergency.py
- + src/mailman/rules/tests/test_implicit_dest.py
- + src/mailman/rules/tests/test_loop.py
- + src/mailman/rules/tests/test_max_recipients.py
- + src/mailman/rules/tests/test_max_size.py
- + src/mailman/rules/tests/test_news_moderation.py


The diff was not included because it is too large.


View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/02826321d0430d7ffc1f674eeff4221941689ef7...ade94e8f833a9472ba9be52a08f4e2f381e7a212

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/02826321d0430d7ffc1f674eeff4221941689ef7...ade94e8f833a9472ba9be52a08f4e2f381e7a212
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][coverage] Boost coverage.

2017-07-24 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch coverage at mailman / Mailman Core


Commits:
8fbcf37a by Barry Warsaw at 2017-07-24T19:54:48-04:00
Boost coverage.

- - - - -


2 changed files:

- src/mailman/rest/listconf.py
- src/mailman/rest/preferences.py


Changes:

=
src/mailman/rest/listconf.py
=
--- a/src/mailman/rest/listconf.py
+++ b/src/mailman/rest/listconf.py
@@ -97,7 +97,7 @@ def pipeline_validator(pipeline_name):
 
 
 def password_bytes_validator(value):
-if value is None or isinstance(value, bytes):
+if value is None or isinstance(value, bytes):   # pragma: nobranch
 return value
 return config.password_context.encrypt(value).encode('utf-8')
 
@@ -196,7 +196,7 @@ def api_attributes(api):
 # attributes, although we map them to templates.  In API 3.1 and beyond,
 # only the template manager API can be used for these.
 attributes = ATTRIBUTES.copy()
-if api.version_info == (3, 0):
+if api.version_info == (3, 0):  # pragma: nobranch
 attributes.update({
 attribute: URIAttributeMapper(str)
 for attribute in TEMPLATE_ATTRIBUTES
@@ -243,7 +243,7 @@ class ListConfiguration:
 # handled by the template manager API.
 validators = VALIDATORS.copy()
 attributes = api_attributes(self.api)
-if self.api.version_info == (3, 0):
+if self.api.version_info == (3, 0): # pragma: nobranch
 validators.update({
 attribute: URIAttributeMapper(str)
 for attribute in TEMPLATE_ATTRIBUTES


=
src/mailman/rest/preferences.py
=
--- a/src/mailman/rest/preferences.py
+++ b/src/mailman/rest/preferences.py
@@ -69,9 +69,7 @@ class Preferences(ReadOnlyPreferences):
 """Preferences which can be changed."""
 
 def _patch_put(self, request, response, is_optional):
-if self._parent is None:
-not_found(response)
-return
+assert self._parent is not None
 kws = dict(
 acknowledge_posts=GetterSetter(as_boolean),
 hide_address=GetterSetter(as_boolean),



View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/8fbcf37a3d9837799f3bb18e5e4395caf60bf44f

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/8fbcf37a3d9837799f3bb18e5e4395caf60bf44f
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][coverage] Boost coverage.

2017-07-24 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch coverage at mailman / Mailman Core


Commits:
f9cfbb32 by Barry Warsaw at 2017-07-24T14:44:41-04:00
Boost coverage.

- - - - -


1 changed file:

- src/mailman/rest/tests/test_header_matches.py


Changes:

=
src/mailman/rest/tests/test_header_matches.py
=
--- a/src/mailman/rest/tests/test_header_matches.py
+++ b/src/mailman/rest/tests/test_header_matches.py
@@ -51,6 +51,17 @@ class TestHeaderMatches(unittest.TestCase):
 self.assertEqual(cm.exception.reason,
  'No header match at this position: 0')
 
+def test_patch_put_missing_header_match(self):
+with self.assertRaises(HTTPError) as cm:
+call_api('http://localhost:9001/3.0/lists/ant.example.com'
+ '/header-matches/0', dict(
+ header='From',
+ ),
+ method='PATCH')
+self.assertEqual(cm.exception.code, 404)
+self.assertEqual(cm.exception.reason,
+ 'No header match at this position: 0')
+
 def test_add_duplicate(self):
 header_matches = IHeaderMatchList(self._mlist)
 with transaction():
@@ -70,3 +81,30 @@ class TestHeaderMatches(unittest.TestCase):
 call_api('http://localhost:9001/3.0/lists/bee.example.com'
  '/header-matches/')
 self.assertEqual(cm.exception.code, 404)
+
+def test_header_match_post_bad_action(self):
+header_matches = IHeaderMatchList(self._mlist)
+with transaction():
+header_matches.append('header', 'pattern')
+with self.assertRaises(HTTPError) as cm:
+call_api('http://localhost:9001/3.0/lists/ant.example.com'
+ '/header-matches', {
+ 'action': 'donothing',
+})
+self.assertEqual(cm.exception.code, 400)
+self.assertEqual(cm.exception.reason,
+ 'Cannot convert parameters: action')
+
+def test_header_match_patch_bad_action(self):
+header_matches = IHeaderMatchList(self._mlist)
+with transaction():
+header_matches.append('header', 'pattern')
+with self.assertRaises(HTTPError) as cm:
+call_api('http://localhost:9001/3.0/lists/ant.example.com'
+ '/header-matches/0', {
+ 'action': 'donothing',
+},
+ method='PATCH')
+self.assertEqual(cm.exception.code, 400)
+self.assertEqual(cm.exception.reason,
+ 'Cannot convert parameters: action')



View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/f9cfbb32144d328aa5a662fb192153616f0cbbf7

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/f9cfbb32144d328aa5a662fb192153616f0cbbf7
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][coverage] Boost coverage and modernize.

2017-07-23 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch coverage at mailman / Mailman Core


Commits:
bf2897a6 by Barry Warsaw at 2017-07-23T08:42:25-05:00
Boost coverage and modernize.

- - - - -


3 changed files:

- src/mailman/rules/docs/suspicious.rst
- src/mailman/rules/suspicious.py
- src/mailman/rules/tests/test_suspicious.py


Changes:

=
src/mailman/rules/docs/suspicious.rst
=
--- a/src/mailman/rules/docs/suspicious.rst
+++ b/src/mailman/rules/docs/suspicious.rst
@@ -6,7 +6,7 @@ Suspicious headers are a way for Mailman to hold messages that 
match a
 particular regular expression.  This mostly historical feature is fairly
 confusing to users, and the list attribute that controls this is misnamed.
 
->>> mlist = create_list('_xt...@example.com')
+>>> mlist = create_list('a...@example.com')
 >>> rule = config.rules['suspicious-header']
 >>> print(rule.name)
 suspicious-header
@@ -16,9 +16,9 @@ Set the so-called suspicious header configuration variable.
 >>> mlist.bounce_matching_headers = 'From: .*person@(blah.)?example.com'
 >>> msg = message_from_string("""\
 ... From: aper...@example.com
-... To: _xt...@example.com
+... To: a...@example.com
 ... Subject: An implicit message
-... 
+...
 ... """)
 >>> rule.check(mlist, msg, {})
 True
@@ -28,9 +28,9 @@ This one comes from a ``.org`` address.
 
 >>> msg = message_from_string("""\
 ... From: aper...@example.org
-... To: _xt...@example.com
+... To: a...@example.com
 ... Subject: An implicit message
-... 
+...
 ... """)
 >>> rule.check(mlist, msg, {})
 False


=
src/mailman/rules/suspicious.py
=
--- a/src/mailman/rules/suspicious.py
+++ b/src/mailman/rules/suspicious.py
@@ -60,7 +60,7 @@ def _parse_matching_header_opt(mlist):
 # This didn't look like a header line.  BAW: should do a
 # better job of informing the list admin.
 log.error('bad bounce_matching_header line: %s\n%s',
-  mlist.display_name, line)
+  mlist.list_id, line)
 else:
 header = line[:i]
 value = line[i+1:].lstrip()
@@ -71,7 +71,7 @@ def _parse_matching_header_opt(mlist):
 # job of informing the list admin.
 log.error("""\
 bad regexp in bounce_matching_header line: %s
-\n%s (cause: %s)""", mlist.display_name, value, error)
+"%s" (cause: %s)""", mlist.list_id, value, error)
 else:
 all.append((header, cre, line))
 return all


=
src/mailman/rules/tests/test_suspicious.py
=
--- a/src/mailman/rules/tests/test_suspicious.py
+++ b/src/mailman/rules/tests/test_suspicious.py
@@ -24,17 +24,24 @@ from email.header import Header
 from mailman.app.lifecycle import create_list
 from mailman.email.message import Message
 from mailman.rules import suspicious
+from mailman.testing.helpers import (
+LogFileMark, specialized_message_from_string as mfs)
 from mailman.testing.layers import ConfigLayer
 
 
 class TestSuspicious(unittest.TestCase):
-"""Test the suspicious rule."""
-
 layer = ConfigLayer
+maxDiff = None
 
 def setUp(self):
-self._mlist = create_list('t...@example.com')
+self._mlist = create_list('a...@example.com')
 self._rule = suspicious.SuspiciousHeader()
+self._msg = mfs("""\
+From: aper...@example.com
+To: a...@example.com
+Subject: A message
+
+""")
 
 def test_header_instance(self):
 msg = Message()
@@ -42,3 +49,29 @@ class TestSuspicious(unittest.TestCase):
 self._mlist.bounce_matching_headers = 'from: s...@example.com'
 result = self._rule.check(self._mlist, msg, {})
 self.assertFalse(result)
+
+def test_bounce_matching_header_not_a_header(self):
+mark = LogFileMark('mailman.error')
+self._mlist.bounce_matching_headers = 'This is not a header'
+result = self._rule.check(self._mlist, self._msg, {})
+self.assertFalse(result)
+log_lines = mark.read().splitlines()
+self.assertEqual(
+log_lines[0][-48:],
+'bad bounce_matching_header line: ant.example.com')
+self.assertEqual(
+log_lines[1][-20:],
+'This is not a header')
+
+def test_bounce_matching_header_not_a_regexp(self):
+mark = LogFileMark('mailman.error')
+self._mlist.bounce_matching_headers = 'From: [a-z'
+result = self._rule.check(self._mlist, self._msg, {})
+self.assertFalse(result)
+log_lines = mark.read().splitlines()
+self.assertEqual(
+log_lines[0][-58:],
+'bad regexp in bounce_matching_header line: ant.example.com')
+self.assertEqual(
+log_lines[1][-56:],
+'"[a-z" 

[Mailman-checkins] [Git][mailman/mailman] Pushed new branch coverage

2017-07-22 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed new branch coverage at mailman / Mailman Core

---
View it on GitLab: https://gitlab.com/mailman/mailman/tree/coverage
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][master] 2 commits: Convert to click for CLI options

2017-07-21 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch master at mailman / Mailman Core


Commits:
f00b94f1 by Barry Warsaw at 2017-07-22T03:02:05+00:00
Convert to click for CLI options

- - - - -
02826321 by Barry Warsaw at 2017-07-22T03:02:06+00:00
Convert to click for CLI options.

Closes #319 and #346


- - - - -


27 changed files:

- .gitlab-ci.yml
- coverage.ini
- setup.py
- src/mailman/__init__.py
- src/mailman/app/docs/hooks.rst
- src/mailman/app/subscriptions.py
- src/mailman/app/workflow.py
- src/mailman/bin/mailman.py
- src/mailman/bin/master.py
- src/mailman/bin/runner.py
- src/mailman/bin/tests/test_mailman.py
- src/mailman/bin/tests/test_master.py
- src/mailman/commands/cli_aliases.py
- src/mailman/commands/cli_conf.py
- src/mailman/commands/cli_control.py
- src/mailman/commands/cli_digests.py
- src/mailman/commands/cli_help.py
- src/mailman/commands/cli_import.py
- src/mailman/commands/cli_info.py
- src/mailman/commands/cli_inject.py
- src/mailman/commands/cli_lists.py
- src/mailman/commands/cli_members.py
- src/mailman/commands/cli_qfile.py
- src/mailman/commands/cli_status.py
- src/mailman/commands/cli_unshunt.py
- src/mailman/commands/cli_version.py
- src/mailman/commands/cli_withlist.py


The diff was not included because it is too large.


View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/f54c045519300f6f70947d1114f46c2b8ae0d368...02826321d0430d7ffc1f674eeff4221941689ef7

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/f54c045519300f6f70947d1114f46c2b8ae0d368...02826321d0430d7ffc1f674eeff4221941689ef7
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][click-cli] One more line that doesn't easily get covered.

2017-07-21 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch click-cli at mailman / Mailman Core


Commits:
4e5ee446 by Barry Warsaw at 2017-07-21T21:44:05-05:00
One more line that doesnt easily get covered.

- - - - -


1 changed file:

- src/mailman/bin/mailman.py


Changes:

=
src/mailman/bin/mailman.py
=
--- a/src/mailman/bin/mailman.py
+++ b/src/mailman/bin/mailman.py
@@ -43,7 +43,7 @@ class Subcommands(click.MultiCommand):
 add_components('mailman.commands', ICLISubCommand, self._commands)
 
 def list_commands(self, ctx):
-return sorted(self._commands)
+return sorted(self._commands)   # pragma: nocover
 
 def get_command(self, ctx, name):
 try:



View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/4e5ee446703d11e23bf99fe014e301c1ddd34e6d

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/4e5ee446703d11e23bf99fe014e301c1ddd34e6d
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][click-cli] Add a comment, remove a blank line, and don't worry about coverage.

2017-07-21 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch click-cli at mailman / Mailman Core


Commits:
49cdb03f by Barry Warsaw at 2017-07-21T13:54:27-05:00
Add a comment, remove a blank line, and dont worry about coverage.

- - - - -


2 changed files:

- src/mailman/bin/mailman.py
- src/mailman/utilities/options.py


Changes:

=
src/mailman/bin/mailman.py
=
--- a/src/mailman/bin/mailman.py
+++ b/src/mailman/bin/mailman.py
@@ -65,6 +65,11 @@ class Subcommands(click.MultiCommand):
 return super().invoke(ctx)
 
 # https://github.com/pallets/click/issues/834
+#
+# Note that this only handles the case for the `mailman --help` output.
+# To handle `mailman  --help` we create a custom click.Command
+# subclass and override this method there too.  See
+# src/mailman/utilities/options.py
 def format_options(self, ctx, formatter):
 """Writes all the options into the formatter if they exist."""
 opts = []
@@ -73,7 +78,6 @@ class Subcommands(click.MultiCommand):
 if rv is not None:
 part_a, part_b = rv
 opts.append((part_a, part_b.replace('\n', ' ')))
-
 if opts:
 with formatter.section('Options'):
 formatter.write_dl(opts)


=
src/mailman/utilities/options.py
=
--- a/src/mailman/utilities/options.py
+++ b/src/mailman/utilities/options.py
@@ -52,8 +52,14 @@ def validate_runner_spec(ctx, param, value):
 
 
 @public
-class I18nCommand(click.Command):
+class I18nCommand(click.Command):   # pragma: nocover
 # https://github.com/pallets/click/issues/834
+#
+# Note that this handles the case for the `mailman  --help`
+# output.  To handle `mailman --help` we override the same method in the
+# `Subcommands` subclass over in src/mailman/bin/mailman.py.  The test
+# suite doesn't cover *this* copy of the method but who cares, since it
+# will hopefully go away some day.
 def format_options(self, ctx, formatter):
 """Writes all the options into the formatter if they exist."""
 opts = []
@@ -62,7 +68,6 @@ class I18nCommand(click.Command):
 if rv is not None:
 part_a, part_b = rv
 opts.append((part_a, part_b.replace('\n', ' ')))
-
 if opts:
 with formatter.section('Options'):
 formatter.write_dl(opts)



View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/49cdb03f8007159513ea4843ca1a86165df218c6

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/49cdb03f8007159513ea4843ca1a86165df218c6
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][click-cli] Fix flake8 complaint.

2017-07-21 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch click-cli at mailman / Mailman Core


Commits:
baa2106a by Barry Warsaw at 2017-07-21T10:30:27-05:00
Fix flake8 complaint.

- - - - -


1 changed file:

- src/mailman/commands/cli_lists.py


Changes:

=
src/mailman/commands/cli_lists.py
=
--- a/src/mailman/commands/cli_lists.py
+++ b/src/mailman/commands/cli_lists.py
@@ -33,8 +33,8 @@ from mailman.interfaces.domain import (
 from mailman.interfaces.languages import ILanguageManager
 from mailman.interfaces.listmanager import IListManager, ListAlreadyExistsError
 from mailman.interfaces.template import ITemplateLoader
-from mailman.utilities.string import expand, wrap
 from mailman.utilities.options import I18nCommand
+from mailman.utilities.string import expand, wrap
 from operator import attrgetter
 from public import public
 from zope.component import getUtility



View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/baa2106a1dc9adc337acc010cfb97c70d1a3cdeb

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/baa2106a1dc9adc337acc010cfb97c70d1a3cdeb
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][click-cli] 3 commits: Suppress an annoying Alembic/SQLite warning.

2017-07-20 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch click-cli at mailman / Mailman Core


Commits:
4da15e6b by Barry Warsaw at 2017-07-20T10:07:49-05:00
Suppress an annoying Alembic/SQLite warning.

- - - - -
fbfe4a9d by Barry Warsaw at 2017-07-20T10:19:14-05:00
100% diffcov.

* Make generic the Python 3 paths in coverage.ini
* Add some pragma: nocovers to runner.py to avoid blocking diffcov tests

- - - - -
7215df53 by Barry Warsaw at 2017-07-20T10:26:55-05:00
One last NEWS update!

- - - - -


4 changed files:

- coverage.ini
- src/mailman/core/runner.py
- src/mailman/database/tests/test_migrations.py
- src/mailman/docs/NEWS.rst


Changes:

=
coverage.ini
=
--- a/coverage.ini
+++ b/coverage.ini
@@ -4,8 +4,8 @@ parallel = true
 omit =
  setup*
  */showme.py
-.tox/*/lib/python3.5/site-packages/*
-.tox/*/lib/python3.5/site-packages/*
+.tox/*/lib/python3.*/site-packages/*
+.tox/*/lib/python3.*/site-packages/*
 */test_*.py
 /tmp/*
 /private/var/folders/*
@@ -21,4 +21,4 @@ exclude_lines =
 [paths]
 source =
 mailman
-.tox/coverage/lib/python*/site-packages/mailman
+.tox/*/lib/python3.*/site-packages/mailman


=
src/mailman/core/runner.py
=
--- a/src/mailman/core/runner.py
+++ b/src/mailman/core/runner.py
@@ -86,7 +86,7 @@ class Runner:
 def __repr__(self):
 return '<{} at {:#x}>'.format(self.__class__.__name__, id(self))
 
-def signal_handler(self, signum, frame):
+def signal_handler(self, signum, frame):# pragma: nocover
 signame = {
 signal.SIGTERM: 'SIGTERM',
 signal.SIGINT: 'SIGINT',


=
src/mailman/database/tests/test_migrations.py
=
--- a/src/mailman/database/tests/test_migrations.py
+++ b/src/mailman/database/tests/test_migrations.py
@@ -35,6 +35,7 @@ from mailman.interfaces.member import MemberRole
 from mailman.interfaces.template import ITemplateManager
 from mailman.interfaces.usermanager import IUserManager
 from mailman.testing.layers import ConfigLayer
+from warnings import catch_warnings, simplefilter
 from zope.component import getUtility
 
 
@@ -63,11 +64,21 @@ class TestMigrations(unittest.TestCase):
 def test_all_migrations(self):
 script_dir = alembic.script.ScriptDirectory.from_config(alembic_cfg)
 revisions = [sc.revision for sc in script_dir.walk_revisions()]
-for revision in revisions:
-alembic.command.downgrade(alembic_cfg, revision)
-revisions.reverse()
-for revision in revisions:
-alembic.command.upgrade(alembic_cfg, revision)
+with catch_warnings():
+simplefilter('ignore', UserWarning)
+# Alembic/SQLite does not like something about these migrations.
+# They're more or less inconsequential in practice (since users
+# will rarely if ever downgrade their database), but it does
+# clutter up the test output, so just suppress the warning.
+#
+# E.g.
+# alembic/util/messaging.py:69: UserWarning:
+# Skipping unsupported ALTER for creation of implicit constraint
+for revision in revisions:
+alembic.command.downgrade(alembic_cfg, revision)
+revisions.reverse()
+for revision in revisions:
+alembic.command.upgrade(alembic_cfg, revision)
 
 def test_42756496720_header_matches(self):
 test_header_matches = [


=
src/mailman/docs/NEWS.rst
=
--- a/src/mailman/docs/NEWS.rst
+++ b/src/mailman/docs/NEWS.rst
@@ -27,7 +27,8 @@ Command line
 * Adopt the ``click`` package for command line parsing.  This makes the
   command line more consistent and pluggable.  Also, many CLIs that accepted a
   "fqdn list name" (i.e. the posting address of a mailing list), now also
-  accept a ``List-ID``.  (Closes #346)
+  accept a ``List-ID``.  Every attempt has been made to keep the CLI backward
+  compatible, but there may be subtle differences.  (Closes #346)
 * Fix ``mailman withlist`` command parsing.  (Closes #319)
 
 Interfaces
@@ -40,6 +41,7 @@ Interfaces
 Other
 -
 * Drop support for Python 3.4.  (Closes #373)
+* Bump minimum requirements for aiosmtpd (>= 1.1) and flufl.lock (>= 3.1).
 
 
 3.1.0 -- "Between The Wheels"



View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/d55ea8615406d13cb1e6a1508b17a98b21797a49...7215df535b109cbd5b56b64d3b4c62ed5235ec7f

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/d55ea8615406d13cb1e6a1508b17a98b21797a49...7215df535b109cbd5b56b64d3b4c62ed5235ec7f
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list

[Mailman-checkins] [Git][mailman/mailman][click-cli] Re-enable some pragmas.

2017-07-19 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch click-cli at mailman / Mailman Core


Commits:
d55ea861 by Barry Warsaw at 2017-07-19T22:44:25-04:00
Re-enable some pragmas.

- - - - -


1 changed file:

- src/mailman/bin/master.py


Changes:

=
src/mailman/bin/master.py
=
--- a/src/mailman/bin/master.py
+++ b/src/mailman/bin/master.py
@@ -399,7 +399,7 @@ class Loop:
 except ChildProcessError:
 # No children?  We're done.
 break
-except InterruptedError:# pragma: nocove
+except InterruptedError:# pragma: nocover
 # If the system call got interrupted, just restart it.
 continue
 # Find out why the subprocess exited by getting the signal
@@ -452,10 +452,10 @@ Runner {0} reached maximum restart limit of {1:d}, not 
restarting.""",
 for pid in self._kids:
 try:
 os.kill(pid, signal.SIGTERM)
-except ProcessLookupError:  # pragma: nocove
+except ProcessLookupError:  # pragma: nocover
 # The child has already exited.
 log.info('ESRCH on pid: %d', pid)
-except OSError: # pragma: nocove
+except OSError: # pragma: nocover
 # XXX I'm not so sure about this.  It preserves the semantics
 # before conversion to PEP 3151 exceptions.  But is it right?
 pass
@@ -466,7 +466,7 @@ Runner {0} reached maximum restart limit of {1:d}, not 
restarting.""",
 self._kids.drop(pid)
 except ChildProcessError:
 break
-except InterruptedError:# pragma: nocove
+except InterruptedError:# pragma: nocover
 continue
 
 



View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/d55ea8615406d13cb1e6a1508b17a98b21797a49

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/d55ea8615406d13cb1e6a1508b17a98b21797a49
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][click-cli] Boost coverage.

2017-07-18 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch click-cli at mailman / Mailman Core


Commits:
b254dfa1 by Barry Warsaw at 2017-07-18T15:41:04-04:00
Boost coverage.

- - - - -


2 changed files:

- src/mailman/commands/cli_withlist.py
- src/mailman/commands/tests/test_cli_shell.py


Changes:

=
src/mailman/commands/cli_withlist.py
=
--- a/src/mailman/commands/cli_withlist.py
+++ b/src/mailman/commands/cli_withlist.py
@@ -266,7 +266,7 @@ def shell(ctx, interactive, run, listspec, run_args):
 # without the dot is allowed.
 dotted_name = (run if '.' in run else '{0}.{0}'.format(run))
 if listspec is None:
-ctx.fail(_('--run requires a mailing list name'))
+ctx.fail(_('--run requires a mailing list'))
 # Parse the run arguments so we can pass them into the run method.
 if listspec.startswith('^'):
 r = {}


=
src/mailman/commands/tests/test_cli_shell.py
=
--- a/src/mailman/commands/tests/test_cli_shell.py
+++ b/src/mailman/commands/tests/test_cli_shell.py
@@ -126,10 +126,10 @@ class TestShell(unittest.TestCase):
 'ipython is not available, set use_ipython to no\n')
 
 def test_regex_without_run(self):
-result = self._command.invoke(shell, ('-l', '^.*example.com'))
-self.assertEqual(result.exit_code, 2)
+results = self._command.invoke(shell, ('-l', '^.*example.com'))
+self.assertEqual(results.exit_code, 2)
 self.assertEqual(
-result.output,
+results.output,
 'Usage: shell [OPTIONS] [RUN_ARGS]...\n\n'
 'Error: Regular expression requires --run\n')
 
@@ -148,9 +148,26 @@ class TestShell(unittest.TestCase):
 "The variable 'm' is the ant.example.com mailing list")
 
 def test_listspec_without_run_no_such_list(self):
-result = self._command.invoke(shell, ('-l', 'ant.example.com'))
-self.assertEqual(result.exit_code, 2)
+results = self._command.invoke(shell, ('-l', 'ant.example.com'))
+self.assertEqual(results.exit_code, 2)
 self.assertEqual(
-result.output,
+results.output,
 'Usage: shell [OPTIONS] [RUN_ARGS]...\n\n'
 'Error: No such list: ant.example.com\n')
+
+def test_run_without_listspec(self):
+results = self._command.invoke(shell, ('--run', 'something'))
+self.assertEqual(results.exit_code, 2)
+self.assertEqual(
+results.output,
+'Usage: shell [OPTIONS] [RUN_ARGS]...\n\n'
+'Error: --run requires a mailing list\n')
+
+def test_run_bogus_listspec(self):
+results = self._command.invoke(
+shell, ('-l', 'bee.example.com', '--run', 'something'))
+self.assertEqual(results.exit_code, 2)
+self.assertEqual(
+results.output,
+'Usage: shell [OPTIONS] [RUN_ARGS]...\n\n'
+'Error: No such list: bee.example.com\n')



View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/b254dfa13f13636b3062b3306649b422189d28dd

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/b254dfa13f13636b3062b3306649b422189d28dd
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][click-cli] Boost coverage.

2017-07-18 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch click-cli at mailman / Mailman Core


Commits:
1edece0b by Barry Warsaw at 2017-07-18T15:33:15-04:00
Boost coverage.

- - - - -


2 changed files:

- src/mailman/commands/cli_inject.py
- src/mailman/commands/tests/test_cli_inject.py


Changes:

=
src/mailman/commands/cli_inject.py
=
--- a/src/mailman/commands/cli_inject.py
+++ b/src/mailman/commands/cli_inject.py
@@ -65,12 +65,12 @@ def show_queues(ctx, param, value):
 Additional metadata key/value pairs to add to the message metadata
 dictionary.  Use the format key=value.  Multiple -m options are
 allowed."""))
-@click.argument('listname')
+@click.argument('listspec')
 @click.pass_context
-def inject(ctx, queue, message_file, keywords, listname):
-mlist = getUtility(IListManager).get(listname)
+def inject(ctx, queue, message_file, keywords, listspec):
+mlist = getUtility(IListManager).get(listspec)
 if mlist is None:
-ctx.fail(_('No such list: $listname'))
+ctx.fail(_('No such list: $listspec'))
 queue_name = ('in' if queue is None else queue)
 switchboard = config.switchboards.get(queue_name)
 if switchboard is None:


=
src/mailman/commands/tests/test_cli_inject.py
=
--- a/src/mailman/commands/tests/test_cli_inject.py
+++ b/src/mailman/commands/tests/test_cli_inject.py
@@ -47,3 +47,20 @@ class TestInject(unittest.TestCase):
 input=InterruptRaisingReader())
 self.assertEqual(results.exit_code, 1)
 self.assertEqual(results.output, 'Interrupted\n')
+
+def test_inject_no_such_list(self):
+result = self._command.invoke(inject, ('bee.example.com',))
+self.assertEqual(result.exit_code, 2)
+self.assertEqual(
+result.output,
+'Usage: inject [OPTIONS] LISTSPEC\n\n'
+'Error: No such list: bee.example.com\n')
+
+def test_inject_no_such_queue(self):
+result = self._command.invoke(
+inject, ('--queue', 'bogus', 'ant.example.com'))
+self.assertEqual(result.exit_code, 2)
+self.assertEqual(
+result.output,
+'Usage: inject [OPTIONS] LISTSPEC\n\n'
+'Error: No such queue: bogus\n')



View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/1edece0bf884a9642d07db014feabfbf5d6e3f3f

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/1edece0bf884a9642d07db014feabfbf5d6e3f3f
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][click-cli] Boost coverage.

2017-07-18 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch click-cli at mailman / Mailman Core


Commits:
66dfa1a1 by Barry Warsaw at 2017-07-18T08:39:34-04:00
Boost coverage.

Remove the debugging `locale` test.

- - - - -


3 changed files:

- .gitlab-ci.yml
- src/mailman/commands/tests/test_cli_control.py
- tox.ini


Changes:

=
.gitlab-ci.yml
=
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -12,11 +12,6 @@ variables:
   MYSQL_DATABASE: "test_mailman"
   LC_ALL: "C.UTF-8"
 
-locale:
-  script:
-  - printenv
-  - locale
-
 qa:
   script:
   - tox -e qa


=
src/mailman/commands/tests/test_cli_control.py
=
--- a/src/mailman/commands/tests/test_cli_control.py
+++ b/src/mailman/commands/tests/test_cli_control.py
@@ -29,7 +29,8 @@ from click.testing import CliRunner
 from contextlib import ExitStack, suppress
 from datetime import datetime, timedelta
 from flufl.lock import SEP
-from mailman.commands.cli_control import start
+from mailman.bin.master import WatcherState
+from mailman.commands.cli_control import reopen, restart, start
 from mailman.config import config
 from mailman.testing.helpers import configuration
 from mailman.testing.layers import ConfigLayer
@@ -159,9 +160,7 @@ def kill_with_extreme_prejudice(pid_or_pidfile=None):
 print('WARNING: SIGKILL DID NOT EXIT PROCESS!', file=sys.stderr)
 
 
-class TestBinDir(unittest.TestCase):
-"""Test issues related to bin_dir, e.g. issue #3"""
-
+class TestControl(unittest.TestCase):
 layer = ConfigLayer
 maxDiff = None
 
@@ -252,3 +251,45 @@ class TestBinDir(unittest.TestCase):
 self.assertEqual(len(self._execl.call_args_list), 1)
 posargs, kws = self._execl.call_args_list[0]
 self.assertIn('--force', posargs)
+
+
+class TestControlSimple(unittest.TestCase):
+layer = ConfigLayer
+maxDiff = None
+
+def setUp(self):
+self._command = CliRunner()
+
+def test_watcher_state_conflict(self):
+with patch('mailman.commands.cli_control.master_state',
+   return_value=(WatcherState.conflict, object())):
+results = self._command.invoke(start)
+self.assertEqual(results.exit_code, 2)
+self.assertEqual(
+results.output,
+'Usage: start [OPTIONS]\n\n'
+'Error: GNU Mailman is already running\n')
+
+def test_reopen(self):
+with patch('mailman.commands.cli_control.kill_watcher') as mock:
+result = self._command.invoke(reopen)
+mock.assert_called_once_with(signal.SIGHUP)
+self.assertEqual(result.output, 'Reopening the Mailman runners\n')
+
+def test_reopen_quiet(self):
+with patch('mailman.commands.cli_control.kill_watcher') as mock:
+result = self._command.invoke(reopen, ('--quiet',))
+mock.assert_called_once_with(signal.SIGHUP)
+self.assertEqual(result.output, '')
+
+def test_restart(self):
+with patch('mailman.commands.cli_control.kill_watcher') as mock:
+result = self._command.invoke(restart)
+mock.assert_called_once_with(signal.SIGUSR1)
+self.assertEqual(result.output, 'Restarting the Mailman runners\n')
+
+def test_restart_quiet(self):
+with patch('mailman.commands.cli_control.kill_watcher') as mock:
+result = self._command.invoke(restart, ('--quiet',))
+mock.assert_called_once_with(signal.SIGUSR1)
+self.assertEqual(result.output, '')


=
tox.ini
=
--- a/tox.ini
+++ b/tox.ini
@@ -10,7 +10,7 @@ commands =
 cov,diffcov: python -m coverage combine {[coverage]rc}
 cov: python -m coverage html {[coverage]rc}
 cov: python -m coverage report -m {[coverage]rc} --fail-under=93
-diffcov: python -m coverage xml -i {[coverage]rc}
+diffcov: python -m coverage xml {[coverage]rc}
 diffcov: diff-cover coverage.xml --html-report diffcov.html
 diffcov: diff-cover coverage.xml --fail-under=100
 #sitepackages = True



View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/66dfa1a1479fc6c0fcddaeeb3e9e68274af71172

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/66dfa1a1479fc6c0fcddaeeb3e9e68274af71172
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][click-cli] Remove an unused import.

2017-07-17 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch click-cli at mailman / Mailman Core


Commits:
cb6a5e30 by Barry Warsaw at 2017-07-17T23:29:14-04:00
Remove an unused import.

- - - - -


1 changed file:

- src/mailman/commands/tests/test_cli_inject.py


Changes:

=
src/mailman/commands/tests/test_cli_inject.py
=
--- a/src/mailman/commands/tests/test_cli_inject.py
+++ b/src/mailman/commands/tests/test_cli_inject.py
@@ -24,7 +24,6 @@ from io import StringIO
 from mailman.app.lifecycle import create_list
 from mailman.commands.cli_inject import inject
 from mailman.testing.layers import ConfigLayer
-from unittest.mock import patch
 
 
 class InterruptRaisingReader(StringIO):



View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/cb6a5e3091d988117b5e021d02d1b622b8fe1f1d

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/cb6a5e3091d988117b5e021d02d1b622b8fe1f1d
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][click-cli] Boost coverage.

2017-07-16 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch click-cli at mailman / Mailman Core


Commits:
bfb352ba by Barry Warsaw at 2017-07-16T15:15:32-04:00
Boost coverage.

- - - - -


1 changed file:

- + src/mailman/commands/tests/test_cli_status.py


Changes:

=
src/mailman/commands/tests/test_cli_status.py
=
--- /dev/null
+++ b/src/mailman/commands/tests/test_cli_status.py
@@ -0,0 +1,64 @@
+# Copyright (C) 2017 by the Free Software Foundation, Inc.
+#
+# This file is part of GNU Mailman.
+#
+# GNU Mailman is free software: you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option)
+# any later version.
+#
+# GNU Mailman is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# GNU Mailman.  If not, see .
+
+"""Test the status command."""
+
+import socket
+import unittest
+
+from click.testing import CliRunner
+from mailman.bin.master import WatcherState
+from mailman.commands.cli_status import status
+from mailman.testing.layers import ConfigLayer
+from unittest.mock import patch
+
+
+class FakeLock:
+details = ('localhost', , None)
+
+
+class TestStatus(unittest.TestCase):
+layer = ConfigLayer
+maxDiff = None
+
+def setUp(self):
+self._command = CliRunner()
+
+def test_stale_lock(self):
+with patch('mailman.commands.cli_status.master_state',
+   return_value=(WatcherState.stale_lock, FakeLock())):
+results = self._command.invoke(status)
+self.assertEqual(results.exit_code,
+ WatcherState.stale_lock.value,
+ results.output)
+self.assertEqual(
+results.output,
+'GNU Mailman is stopped (stale pid: )\n',
+results.output)
+
+def test_unknown_state(self):
+with patch('mailman.commands.cli_status.master_state',
+   return_value=(WatcherState.host_mismatch, FakeLock())):
+results = self._command.invoke(status)
+self.assertEqual(results.exit_code,
+ WatcherState.host_mismatch.value,
+ results.output)
+self.assertEqual(
+results.output,
+'GNU Mailman is in an unexpected state '
+'(localhost != {})\n'.format(socket.getfqdn()),
+results.output)



View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/bfb352baa956b81071ad1772f4662cee50a992ef

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/bfb352baa956b81071ad1772f4662cee50a992ef
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][click-cli] Full coverage for option utilities.

2017-07-16 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch click-cli at mailman / Mailman Core


Commits:
49f7cb3d by Barry Warsaw at 2017-07-16T14:55:10-04:00
Full coverage for option utilities.

- - - - -


1 changed file:

- + src/mailman/utilities/tests/test_options.py


Changes:

=
src/mailman/utilities/tests/test_options.py
=
--- /dev/null
+++ b/src/mailman/utilities/tests/test_options.py
@@ -0,0 +1,50 @@
+# Copyright (C) 2017 by the Free Software Foundation, Inc.
+#
+# This file is part of GNU Mailman.
+#
+# GNU Mailman is free software: you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option)
+# any later version.
+#
+# GNU Mailman is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# GNU Mailman.  If not, see .
+
+"""Test option utilities."""
+
+import click
+import unittest
+
+from mailman.utilities.options import validate_runner_spec
+
+
+class TestValidateRunnerSpec(unittest.TestCase):
+def test_false_value(self):
+self.assertIsNone(validate_runner_spec(None, None, None))
+
+def test_runner_only(self):
+specs = validate_runner_spec(None, None, 'incoming')
+self.assertEqual(specs, ('incoming', 1, 1))
+
+def test_full_runner_spec(self):
+specs = validate_runner_spec(None, None, 'incoming:2:4')
+self.assertEqual(specs, ('incoming', 2, 4))
+
+def test_bad_runner_spec(self):
+with self.assertRaises(click.BadParameter) as cm:
+validate_runner_spec(None, None, 'incoming:not:int')
+self.assertEqual(
+cm.exception.message,
+'slice and range must be integers: incoming:not:int')
+
+def test_bad_runner_spec_parts(self):
+with self.assertRaises(click.UsageError) as cm:
+validate_runner_spec(None, None, 'incoming:2')
+self.assertEqual(
+cm.exception.message,
+'Bad runner spec: incoming:2')



View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/49f7cb3d07f62541b00d3fa8de7e5359bce43538

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/49f7cb3d07f62541b00d3fa8de7e5359bce43538
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][click-cli] Remove some code which will never be reached.

2017-07-16 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch click-cli at mailman / Mailman Core


Commits:
c85068dc by Barry Warsaw at 2017-07-16T14:18:25-04:00
Remove some code which will never be reached.

- - - - -


2 changed files:

- src/mailman/commands/cli_import.py
- src/mailman/commands/cli_inject.py


Changes:

=
src/mailman/commands/cli_import.py
=
--- a/src/mailman/commands/cli_import.py
+++ b/src/mailman/commands/cli_import.py
@@ -58,9 +58,6 @@ to import and the path to the Mailman 2.1 pickle file."""))
 type=click.File(mode='rb'))
 @click.pass_context
 def import_21(ctx, listspec, pickle_file):
-# Could be None or sequence of length 0.
-if listspec is None:
-ctx.fail(_('List name or ID is required'))
 mlist = getUtility(IListManager).get(listspec)
 if mlist is None:
 ctx.fail(_('No such list: $listspec'))


=
src/mailman/commands/cli_inject.py
=
--- a/src/mailman/commands/cli_inject.py
+++ b/src/mailman/commands/cli_inject.py
@@ -68,8 +68,6 @@ def show_queues(ctx, param, value):
 @click.argument('listname')
 @click.pass_context
 def inject(ctx, queue, message_file, keywords, listname):
-if listname is None:
-ctx.fail(_('List name is required'))
 mlist = getUtility(IListManager).get(listname)
 if mlist is None:
 ctx.fail(_('No such list: $listname'))



View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/c85068dca514cc4adea0b32140113e51304472d7

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/c85068dca514cc4adea0b32140113e51304472d7
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][click-cli] Work around a CI environment problem.

2017-07-16 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch click-cli at mailman / Mailman Core


Commits:
0b55836e by Barry Warsaw at 2017-07-16T11:38:38-04:00
Work around a CI environment problem.

- - - - -


1 changed file:

- src/mailman/app/docs/hooks.rst


Changes:

=
src/mailman/app/docs/hooks.rst
=
--- a/src/mailman/app/docs/hooks.rst
+++ b/src/mailman/app/docs/hooks.rst
@@ -53,10 +53,10 @@ script that will produce no output to force the hooks to 
run.
 >>> from mailman.testing.layers import ConfigLayer
 >>> def call():
 ... exe = os.path.join(os.path.dirname(sys.executable), 'mailman')
-... env = dict(
+... env = os.environ.copy()
+... env.update(
 ... MAILMAN_CONFIG_FILE=config_path,
 ... PYTHONPATH=config_directory,
-... LANG=os.environ['LANG'],
 ... )
 ... test_cfg = os.environ.get('MAILMAN_EXTRA_TESTING_CFG')
 ... if test_cfg is not None:



View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/0b55836ec62d7d33a8cfc687774ec37a39474ede

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/0b55836ec62d7d33a8cfc687774ec37a39474ede
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman] Deleted branch 34-no-more

2017-07-13 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw deleted branch 34-no-more at mailman / Mailman

---

You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][master] 2 commits: Python 3.4 no more!

2017-07-13 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch master at mailman / Mailman


Commits:
c88cbefd by Barry Warsaw at 2017-07-13T19:05:10-04:00
Python 3.4 no more!

- - - - -
f54c0455 by Barry Warsaw at 2017-07-14T02:52:22+00:00
Merge branch 34-no-more into master

Python 3.4 no more!

Closes #373

See merge request !302
- - - - -


4 changed files:

- .gitlab-ci.yml
- setup.py
- src/mailman/docs/NEWS.rst
- tox.ini


Changes:

=
.gitlab-ci.yml
=
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -21,13 +21,13 @@ docs:
 
 sqlite:
   script:
-  - tox -e py34-nocov,py35-nocov,py36-nocov
+  - tox -e py35-nocov,py36-nocov
 
 pgsql:
   services:
   - postgres:latest
   script:
-  - MAILMAN_EXTRA_TESTING_CFG=/home/runner/configs/postgres.cfg tox -e 
py34-nocov-pg,py35-nocov-pg,py36-nocov-pg
+  - MAILMAN_EXTRA_TESTING_CFG=/home/runner/configs/postgres.cfg tox -e 
py35-nocov-pg,py36-nocov-pg
   tags:
   - postgres
 
@@ -35,12 +35,12 @@ mysql:
   services:
   - mysql:latest
   script:
-  - MAILMAN_EXTRA_TESTING_CFG=/home/runner/configs/mysql.cfg tox -e 
py34-nocov-mysql,py35-nocov-mysql,py36-nocov-mysql
+  - MAILMAN_EXTRA_TESTING_CFG=/home/runner/configs/mysql.cfg tox -e 
py35-nocov-mysql,py36-nocov-mysql
   tags:
   - mysql
 
 diffcov:
   script:
-  - tox -e py34-diffcov,py35-diffcov,py36-diffcov
+  - tox -e py35-diffcov,py36-diffcov
   except:
   - master


=
setup.py
=
--- a/setup.py
+++ b/setup.py
@@ -22,8 +22,8 @@ from setuptools import setup, find_packages
 from string import Template
 
 
-if sys.hexversion < 0x30400f0:
-print('Mailman requires at least Python 3.4')
+if sys.hexversion < 0x30500f0:
+print('Mailman requires at least Python 3.5')
 sys.exit(1)
 
 


=
src/mailman/docs/NEWS.rst
=
--- a/src/mailman/docs/NEWS.rst
+++ b/src/mailman/docs/NEWS.rst
@@ -29,6 +29,10 @@ Interfaces
common use case.  There's now a separate ``.get_by_fqdn()`` which only
accepts the latter and mirrors the already existing ``.get_by_list_id()``.
 
+Other
+-
+ * Drop support for Python 3.4.  (Closes #373)
+
 
 3.1.0 -- "Between The Wheels"
 =


=
tox.ini
=
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,5 @@
 [tox]
-envlist = {py34,py35,py36}-{nocov,cov,diffcov}{,-mysql,-pg},qa
+envlist = {py35,py36}-{nocov,cov,diffcov}{,-mysql,-pg},qa
 #recreate = True
 skip_missing_interpreters = True
 



View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/5baaf8d136ca7ce1669be97517f1febf1276def8...f54c045519300f6f70947d1114f46c2b8ae0d368

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/5baaf8d136ca7ce1669be97517f1febf1276def8...f54c045519300f6f70947d1114f46c2b8ae0d368
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman] Pushed new branch 34-no-more

2017-07-13 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed new branch 34-no-more at mailman / Mailman

---
View it on GitLab: https://gitlab.com/mailman/mailman/tree/34-no-more
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][click-cli] Maybe it's tox smashing the locale variables.

2017-07-09 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch click-cli at mailman / Mailman


Commits:
85015831 by Barry Warsaw at 2017-07-09T15:59:49-04:00
Maybe its tox smashing the locale variables.

- - - - -


1 changed file:

- tox.ini


Changes:

=
tox.ini
=
--- a/tox.ini
+++ b/tox.ini
@@ -25,6 +25,8 @@ deps =
 passenv =
 MAILMAN_*
 PYTHON*
+LANG*
+LC_*
 setenv =
 cov: COVERAGE_PROCESS_START={[coverage]rcfile}
 cov: COVERAGE_OPTIONS="-p"



View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/85015831b659d9f58f16a2ca69f54dca24e02716

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/85015831b659d9f58f16a2ca69f54dca24e02716
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][click-cli] More debugging

2017-07-09 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch click-cli at mailman / Mailman


Commits:
a9744a49 by Barry Warsaw at 2017-07-09T15:57:59-04:00
More debugging

- - - - -


1 changed file:

- .gitlab-ci.yml


Changes:

=
.gitlab-ci.yml
=
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -12,6 +12,11 @@ variables:
   MYSQL_DATABASE: "test_mailman"
   LC_ALL: "C.UTF-8"
 
+locale:
+  script:
+  - printenv
+  - locale
+
 qa:
   script:
   - tox -e qa



View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/a9744a49da94e2bbe2c42034215bea3bc4ea51c4

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/a9744a49da94e2bbe2c42034215bea3bc4ea51c4
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][click-cli] 2 commits: We have to drop Python 3.4.

2017-07-09 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch click-cli at mailman / Mailman


Commits:
215275f0 by Barry Warsaw at 2017-07-09T15:45:21-04:00
We have to drop Python 3.4.

- - - - -
5038ab5d by Barry Warsaw at 2017-07-09T15:47:23-04:00
Debugging.

- - - - -


4 changed files:

- .gitlab-ci.yml
- src/mailman/docs/contribute.rst
- src/mailman/testing/helpers.py
- tox.ini


Changes:

=
.gitlab-ci.yml
=
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -22,13 +22,13 @@ docs:
 
 sqlite:
   script:
-  - tox -e py34-nocov,py35-nocov,py36-nocov
+  - tox -e py35-nocov,py36-nocov
 
 pgsql:
   services:
   - postgres:latest
   script:
-  - MAILMAN_EXTRA_TESTING_CFG=/home/runner/configs/postgres.cfg tox -e 
py34-nocov-pg,py35-nocov-pg,py36-nocov-pg
+  - MAILMAN_EXTRA_TESTING_CFG=/home/runner/configs/postgres.cfg tox -e 
py35-nocov-pg,py36-nocov-pg
   tags:
   - postgres
 
@@ -36,12 +36,12 @@ mysql:
   services:
   - mysql:latest
   script:
-  - MAILMAN_EXTRA_TESTING_CFG=/home/runner/configs/mysql.cfg tox -e 
py34-nocov-mysql,py35-nocov-mysql,py36-nocov-mysql
+  - MAILMAN_EXTRA_TESTING_CFG=/home/runner/configs/mysql.cfg tox -e 
py35-nocov-mysql,py36-nocov-mysql
   tags:
   - mysql
 
 diffcov:
   script:
-  - tox -e py34-diffcov,py35-diffcov,py36-diffcov
+  - tox -e py35-diffcov,py36-diffcov
   except:
   - master


=
src/mailman/docs/contribute.rst
=
--- a/src/mailman/docs/contribute.rst
+++ b/src/mailman/docs/contribute.rst
@@ -62,7 +62,6 @@ of these command, depending on which version of Python 3 you 
have::
 
 $ tox -e py36-nocov
 $ tox -e py35-nocov
-$ tox -e py34-nocov
 
 You can run individual tests in any given environment by providing additional
 positional arguments.  For example, to run only the tests that match a


=
src/mailman/testing/helpers.py
=
--- a/src/mailman/testing/helpers.py
+++ b/src/mailman/testing/helpers.py
@@ -562,6 +562,7 @@ def hackenv(envar, new_value):
 
 
 def nose2_start_test_run_callback(plugin):
+print('** LOCALE ENV **', file=sys.stderr)
 for name in sorted(os.environ):
 if name.startswith('LC_') or name.startswith('LANG'):
 print('{}: {}'.format(name, os.environ[name]), file=sys.stderr)


=
tox.ini
=
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,5 @@
 [tox]
-envlist = {py34,py35,py36}-{nocov,cov,diffcov}{,-mysql,-pg},qa
+envlist = {py35,py36}-{nocov,cov,diffcov}{,-mysql,-pg},qa
 #recreate = True
 skip_missing_interpreters = True
 



View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/f3c9b2b22b93dec7e1699e1c075162e974b3c04b...5038ab5d232a2069dcfa00ab286deb1d7423f42c

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/f3c9b2b22b93dec7e1699e1c075162e974b3c04b...5038ab5d232a2069dcfa00ab286deb1d7423f42c
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][click-cli] Debugging the locale.

2017-07-09 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch click-cli at mailman / Mailman


Commits:
f3c9b2b2 by Barry Warsaw at 2017-07-09T15:35:39-04:00
Debugging the locale.

- - - - -


1 changed file:

- src/mailman/testing/helpers.py


Changes:

=
src/mailman/testing/helpers.py
=
--- a/src/mailman/testing/helpers.py
+++ b/src/mailman/testing/helpers.py
@@ -562,6 +562,9 @@ def hackenv(envar, new_value):
 
 
 def nose2_start_test_run_callback(plugin):
+for name in sorted(os.environ):
+if name.startswith('LC_') or name.startswith('LANG'):
+print('{}: {}'.format(name, os.environ[name]), file=sys.stderr)
 from mailman.testing.layers import ConfigLayer, MockAndMonkeyLayer
 MockAndMonkeyLayer.testing_mode = True
 if (plugin.stderr or



View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/f3c9b2b22b93dec7e1699e1c075162e974b3c04b

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/f3c9b2b22b93dec7e1699e1c075162e974b3c04b
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][click-cli] Remove some unused imports.

2017-07-09 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch click-cli at mailman / Mailman


Commits:
c2a2cd6c by Barry Warsaw at 2017-07-09T15:31:22-04:00
Remove some unused imports.

- - - - -


2 changed files:

- src/mailman/commands/cli_withlist.py
- src/mailman/commands/tests/test_control.py


Changes:

=
src/mailman/commands/cli_withlist.py
=
--- a/src/mailman/commands/cli_withlist.py
+++ b/src/mailman/commands/cli_withlist.py
@@ -21,7 +21,6 @@ import re
 import sys
 import click
 
-from collections import OrderedDict
 from contextlib import ExitStack, suppress
 from functools import partial
 from lazr.config import as_boolean


=
src/mailman/commands/tests/test_control.py
=
--- a/src/mailman/commands/tests/test_control.py
+++ b/src/mailman/commands/tests/test_control.py
@@ -28,7 +28,7 @@ import unittest
 from click.testing import CliRunner
 from contextlib import ExitStack, suppress
 from datetime import datetime, timedelta
-from mailman.commands.cli_control import kill_watcher, start
+from mailman.commands.cli_control import start
 from mailman.config import Configuration, config
 from mailman.testing.helpers import configuration
 from mailman.testing.layers import ConfigLayer



View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/c2a2cd6cfc062291c5fe98568824a92059b935d6

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/c2a2cd6cfc062291c5fe98568824a92059b935d6
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][click-cli] Try setting the LC_ALL environment variable globally.

2017-07-09 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch click-cli at mailman / Mailman


Commits:
be398631 by Barry Warsaw at 2017-07-09T15:19:25-04:00
Try setting the LC_ALL environment variable globally.

- - - - -


1 changed file:

- .gitlab-ci.yml


Changes:

=
.gitlab-ci.yml
=
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -10,6 +10,7 @@ variables:
   MYSQL_USER: "runner"
   MYSQL_USER_PASSWORD: "runner"
   MYSQL_DATABASE: "test_mailman"
+  LC_ALL: "C.UTF-8"
 
 qa:
   script:



View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/be398631f852250a7671ad02eab3dabcd375389a

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/be398631f852250a7671ad02eab3dabcd375389a
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][click-cli] Fix aliases.rst.

2017-07-08 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch click-cli at mailman / Mailman


Commits:
7a5e2996 by Barry Warsaw at 2017-07-08T15:17:05-04:00
Fix aliases.rst.

Hopefully finally crush an intermittent test hang.

- - - - -


2 changed files:

- src/mailman/commands/docs/aliases.rst
- src/mailman/commands/tests/test_control.py


Changes:

=
src/mailman/commands/docs/aliases.rst
=
--- a/src/mailman/commands/docs/aliases.rst
+++ b/src/mailman/commands/docs/aliases.rst
@@ -8,10 +8,8 @@ server.  Generally these files are automatically kept 
up-to-date when mailing
 lists are created or removed, but you might occasionally need to manually
 regenerate the file.  The ``mailman aliases`` command does this.
 
->>> class FakeArgs:
-... directory = None
->>> from mailman.commands.cli_aliases import Aliases
->>> command = Aliases()
+>>> from mailman.commands.cli_aliases import aliases
+>>> command = cli(aliases)
 
 For example, connecting Mailman to Postfix is generally done through the LMTP
 protocol.  Mailman starts an LMTP server and Postfix delivers messages to
@@ -28,17 +26,20 @@ generation.
 ... lmtp_port: 24
 ... """)
 
+..
+Clean up.
+>>> ignore = cleanups.callback(config.pop, 'postfix')
+
 Let's create a mailing list and then display the transport map for it.  We'll
 write the appropriate files to a temporary directory.
 ::
 
+>>> mlist = create_list('a...@example.com')
+
 >>> import os, shutil, tempfile
 >>> output_directory = tempfile.mkdtemp()
 >>> ignore = cleanups.callback(shutil.rmtree, output_directory)
-
->>> FakeArgs.directory = output_directory
->>> mlist = create_list('t...@example.com')
->>> command.process(FakeArgs)
+>>> command('--directory', output_directory)
 
 For Postfix, there are two files in the output directory.
 
@@ -54,15 +55,15 @@ The transport map file contains all the aliases for the 
mailing list.
 ... print(fp.read())
 # AUTOMATICALLY GENERATED BY MAILMAN ON ...
 ...
-t...@example.com   lmtp:[lmtp.example.com]:24
-test-boun...@example.com   lmtp:[lmtp.example.com]:24
-test-conf...@example.com   lmtp:[lmtp.example.com]:24
-test-j...@example.com  lmtp:[lmtp.example.com]:24
-test-le...@example.com lmtp:[lmtp.example.com]:24
-test-ow...@example.com lmtp:[lmtp.example.com]:24
-test-requ...@example.com   lmtp:[lmtp.example.com]:24
-test-subscr...@example.com lmtp:[lmtp.example.com]:24
-test-unsubscr...@example.com   lmtp:[lmtp.example.com]:24
+a...@example.com   lmtp:[lmtp.example.com]:24
+ant-boun...@example.com   lmtp:[lmtp.example.com]:24
+ant-conf...@example.com   lmtp:[lmtp.example.com]:24
+ant-j...@example.com  lmtp:[lmtp.example.com]:24
+ant-le...@example.com lmtp:[lmtp.example.com]:24
+ant-ow...@example.com lmtp:[lmtp.example.com]:24
+ant-requ...@example.com   lmtp:[lmtp.example.com]:24
+ant-subscr...@example.com lmtp:[lmtp.example.com]:24
+ant-unsubscr...@example.com   lmtp:[lmtp.example.com]:24
 
 
 The relay domains file contains a list of all the domains.
@@ -72,7 +73,3 @@ The relay domains file contains a list of all the domains.
 # AUTOMATICALLY GENERATED BY MAILMAN ON ...
 ...
 example.com example.com
-
-..
-Clean up.
->>> config.pop('postfix')


=
src/mailman/commands/tests/test_control.py
=
--- a/src/mailman/commands/tests/test_control.py
+++ b/src/mailman/commands/tests/test_control.py
@@ -143,8 +143,7 @@ class TestStart(unittest.TestCase):
 except FileNotFoundError:
 # There is no master, so just ignore this.
 return
-kill_watcher(signal.SIGTERM)
-os.waitpid(master_pid, 0)
+kill_with_extreme_prejudice(master_pid)
 
 def test_force_stale_lock(self):
 # Fake an acquisition of the master lock by another process, which



View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/7a5e2996ee37c9b46350b0e1c5f091e6eb8c2794

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/7a5e2996ee37c9b46350b0e1c5f091e6eb8c2794
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][click-cli] Fix test for click locale.

2017-07-07 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch click-cli at mailman / Mailman


Commits:
969a7600 by Barry Warsaw at 2017-07-07T22:49:48-04:00
Fix test for click locale.

- - - - -


1 changed file:

- src/mailman/app/docs/hooks.rst


Changes:

=
src/mailman/app/docs/hooks.rst
=
--- a/src/mailman/app/docs/hooks.rst
+++ b/src/mailman/app/docs/hooks.rst
@@ -53,8 +53,11 @@ script that will produce no output to force the hooks to run.
 >>> from mailman.testing.layers import ConfigLayer
 >>> def call():
 ... exe = os.path.join(os.path.dirname(sys.executable), 'mailman')
-... env = dict(MAILMAN_CONFIG_FILE=config_path,
-...PYTHONPATH=config_directory)
+... env = dict(
+... MAILMAN_CONFIG_FILE=config_path,
+... PYTHONPATH=config_directory,
+... LANG=os.environ['LANG'],
+... )
 ... test_cfg = os.environ.get('MAILMAN_EXTRA_TESTING_CFG')
 ... if test_cfg is not None:
 ... env['MAILMAN_EXTRA_TESTING_CFG'] = test_cfg



View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/969a7600a4e175d016d642540413a3903d6e9122

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/969a7600a4e175d016d642540413a3903d6e9122
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][click-cli] Update test_import.py

2017-07-07 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch click-cli at mailman / Mailman


Commits:
cbad9cc7 by Barry Warsaw at 2017-07-07T16:07:40-04:00
Update test_import.py

- - - - -


1 changed file:

- src/mailman/commands/tests/test_import.py


Changes:

=
src/mailman/commands/tests/test_import.py
=
--- a/src/mailman/commands/tests/test_import.py
+++ b/src/mailman/commands/tests/test_import.py
@@ -19,26 +19,19 @@
 
 import unittest
 
+from click.testing import CliRunner
 from mailman.app.lifecycle import create_list
-from mailman.commands.cli_import import Import21
+from mailman.commands.cli_import import import_21
 from mailman.testing.layers import ConfigLayer
 from pkg_resources import resource_filename
 from unittest.mock import patch
 
 
-class FakeArgs:
-listname = ['t...@example.com']
-pickle_file = [
-resource_filename('mailman.testing', 'config-with-instances.pck'),
-]
-
-
 class TestImport(unittest.TestCase):
 layer = ConfigLayer
 
 def setUp(self):
-self.command = Import21()
-self.args = FakeArgs()
+self._command = CliRunner()
 self.mlist = create_list('t...@example.com')
 
 @patch('mailman.commands.cli_import.import_config_pck')
@@ -47,8 +40,10 @@ class TestImport(unittest.TestCase):
 # _BounceInfo instances.  We throw these away when importing to
 # Mailman 3, but we have to fake the instance's classes, otherwise
 # unpickling the dictionaries will fail.
+pickle_file = resource_filename(
+'mailman.testing', 'config-with-instances.pck')
 try:
-self.command.process(self.args)
+self._command.invoke(import_21, ('t...@example.com', pickle_file))
 except ImportError as error:
 self.fail('The pickle failed loading: {}'.format(error))
 self.assertTrue(import_config_pck.called)



View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/cbad9cc756ba3469b79325b87039e1a7c3ea430c

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/cbad9cc756ba3469b79325b87039e1a7c3ea430c
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][click-cli] 2 commits: Convert to click.

2017-07-05 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch click-cli at mailman / Mailman


Commits:
4f698bf5 by Barry Warsaw at 2017-07-05T22:23:31-04:00
Convert to click.

- - - - -
0ab69fa8 by Barry Warsaw at 2017-07-05T22:29:59-04:00
Fix some obvious problems.

- - - - -


2 changed files:

- src/mailman/commands/tests/test_control.py
- src/mailman/commands/tests/test_lists.py


Changes:

=
src/mailman/commands/tests/test_control.py
=
--- a/src/mailman/commands/tests/test_control.py
+++ b/src/mailman/commands/tests/test_control.py
@@ -45,13 +45,13 @@ def make_config(tmpdir):
 # runners, but we don't care about any of them, so write a test
 # configuration file for the master that disables all the runners.
 new_config = 'no-runners.cfg'
-config_file = os.path.join(tmpdir, new_config)
+config_file = os.path.join(tmpdir.name, new_config)
 shutil.copyfile(config.filename, config_file)
 with open(config_file, 'a') as fp:
-print('[paths.here]\npid_file: {}\n\n'.format(pidfile))
+print('[paths.here]\npid_file: {}\n\n'.format(pidfile), file=fp)
 for runner_config in config.runner_configs:
 print('[{}]\nstart:no\n'.format(runner_config.name), file=fp)
-return config_file
+return config_file, pidfile
 
 
 def find_master():


=
src/mailman/commands/tests/test_lists.py
=
--- a/src/mailman/commands/tests/test_lists.py
+++ b/src/mailman/commands/tests/test_lists.py
@@ -19,26 +19,20 @@
 
 import unittest
 
-from io import StringIO
+from click.testing import CliRunner
 from mailman.app.lifecycle import create_list
-from mailman.commands.cli_lists import Lists
+from mailman.commands.cli_lists import lists
 from mailman.interfaces.domain import IDomainManager
 from mailman.testing.layers import ConfigLayer
-from unittest.mock import patch
 from zope.component import getUtility
 
 
-class FakeArgs:
-advertised = False
-names = False
-descriptions = False
-quiet = False
-domain = []
-
-
 class TestLists(unittest.TestCase):
 layer = ConfigLayer
 
+def setUp(self):
+self._runner = CliRunner()
+
 def test_lists_with_domain_option(self):
 # LP: #1166911 - non-matching lists were returned.
 getUtility(IDomainManager).add(
@@ -48,14 +42,8 @@ class TestLists(unittest.TestCase):
 # Only this one should show up.
 create_list('te...@example.net')
 create_list('te...@example.com')
-command = Lists()
-args = FakeArgs()
-args.domain.append('example.net')
-output = StringIO()
-with patch('sys.stdout', output):
-command.process(args)
-lines = output.getvalue().splitlines()
-# The first line is the heading, so skip that.
-lines.pop(0)
-self.assertEqual(len(lines), 1, lines)
-self.assertEqual(lines[0], 'te...@example.net')
+result = self._runner.invoke(lists, ('-d', 'example.net'))
+self.assertEqual(result.exit_code, 0)
+self.assertEqual(
+result.output,
+'1 matching mailing lists found:\nte...@example.net\n')



View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/4ec4fbc73cc0f911b8ec7ed3983d09942660a4c4...0ab69fa8471a5f18a9febbfaf55983e3320ad527

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/4ec4fbc73cc0f911b8ec7ed3983d09942660a4c4...0ab69fa8471a5f18a9febbfaf55983e3320ad527
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][master] 2 commits: Fixed an AttributeError in subject prefixing.

2017-06-30 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch master at mailman / Mailman


Commits:
e9235932 by Mark Sapiro at 2017-06-30T11:54:27-07:00
Fixed an AttributeError in subject prefixing.

- - - - -
eaf5894e by Barry Warsaw at 2017-06-30T21:13:03+00:00
Merge branch prefix into master

Fixed an AttributeError in subject prefixing.

Closes #359

See merge request !295
- - - - -


3 changed files:

- src/mailman/docs/NEWS.rst
- src/mailman/handlers/subject_prefix.py
- src/mailman/handlers/tests/test_subject_prefix.py


Changes:

=
src/mailman/docs/NEWS.rst
=
--- a/src/mailman/docs/NEWS.rst
+++ b/src/mailman/docs/NEWS.rst
@@ -17,6 +17,8 @@ Bugs
  * A missing html_to_plain_text_command is now properly detected and logged.
(Closes #345)
  * Syntactically invalid sender addresses are now ignored.  (Closes #229)
+ * An AttributeError: 'str' object has no attribute 'decode' exception in
+   subject prefixing is fixed.  (Closes #359)
 
 Interfaces
 --


=
src/mailman/handlers/subject_prefix.py
=
--- a/src/mailman/handlers/subject_prefix.py
+++ b/src/mailman/handlers/subject_prefix.py
@@ -69,7 +69,10 @@ def all_same_charset(mlist, msgdata, subject, prefix, 
prefix_pattern, ws):
 for chunk, charset in decode_header(subject.encode()):
 if charset is None:
 charset = 'us-ascii'
-chunks.append(chunk.decode(charset))
+if isinstance(chunk, str):
+chunks.append(chunk)
+else:
+chunks.append(chunk.decode(charset))
 if charset != list_charset:
 return None
 subject_text = EMPTYSTRING.join(chunks)
@@ -111,7 +114,10 @@ def mixed_charsets(mlist, msgdata, subject, prefix, 
prefix_pattern, ws):
 chunk_text, chunk_charset = chunks[0]
 if chunk_charset is None:
 chunk_charset = 'us-ascii'
-first_text = chunk_text.decode(chunk_charset)
+if isinstance(chunk_text, str):
+first_text = chunk_text
+else:
+first_text = chunk_text.decode(chunk_charset)
 first_text = re.sub(prefix_pattern, '', first_text).lstrip()
 rematch = re.match(RE_PATTERN, first_text, re.I)
 if rematch:


=
src/mailman/handlers/tests/test_subject_prefix.py
=
--- a/src/mailman/handlers/tests/test_subject_prefix.py
+++ b/src/mailman/handlers/tests/test_subject_prefix.py
@@ -22,7 +22,9 @@ import unittest
 from mailman.app.lifecycle import create_list
 from mailman.config import config
 from mailman.email.message import Message
+from mailman.interfaces.languages import ILanguageManager
 from mailman.testing.layers import ConfigLayer
+from zope.component import getUtility
 
 
 class TestSubjectPrefix(unittest.TestCase):
@@ -121,3 +123,16 @@ class TestSubjectPrefix(unittest.TestCase):
 subject.encode(),
 '[Test 456] Re: =?iso-2022-jp?b?GyRCJWEhPCVrJV4lcxsoQg==?=')
 self.assertEqual(str(subject), '[Test 456] Re: メールマン')
+
+def test_decode_header_returns_string(self):
+# Under some circumstances, email.header.decode_header() returns a
+# string value.  Ensure we can handle that.
+manager = getUtility(ILanguageManager)
+manager.add('xx', 'iso-8859-1', 'Xlandia')
+self._mlist.preferred_language = 'xx'
+msg = Message()
+msg['Subject'] = 'Plain text'
+self._process(self._mlist, msg, {})
+subject = msg['subject']
+self.assertEqual(subject.encode(),
+ '=?iso-8859-1?q?=5BTest=5D_?= Plain text')



View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/5b7eeedd19ac69976b38aec1132b1f23d963938d...eaf5894e673269e2f07a28e5960c9650ee205001

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/5b7eeedd19ac69976b38aec1132b1f23d963938d...eaf5894e673269e2f07a28e5960c9650ee205001
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][master] 2 commits: Ignore syntactically invalid sender addresses.

2017-06-29 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch master at mailman / Mailman


Commits:
c14032bc by Mark Sapiro at 2017-06-30T03:42:06+00:00
Ignore syntactically invalid sender addresses.

- - - - -
5b7eeedd by Barry Warsaw at 2017-06-30T03:42:09+00:00
Merge branch senders into master

Ignore syntactically invalid sender addresses.

Closes #229

See merge request !294
- - - - -


3 changed files:

- src/mailman/docs/NEWS.rst
- src/mailman/email/message.py
- src/mailman/runners/tests/test_incoming.py


Changes:

=
src/mailman/docs/NEWS.rst
=
--- a/src/mailman/docs/NEWS.rst
+++ b/src/mailman/docs/NEWS.rst
@@ -15,7 +15,8 @@ Here is a history of user visible changes to Mailman.
 Bugs
 
  * A missing html_to_plain_text_command is now properly detected and logged.
-   (closes #345)
+   (Closes #345)
+ * Syntactically invalid sender addresses are now ignored.  (Closes #229)
 
 Interfaces
 --


=
src/mailman/email/message.py
=
--- a/src/mailman/email/message.py
+++ b/src/mailman/email/message.py
@@ -30,7 +30,9 @@ import email.utils
 from email.header import Header
 from email.mime.multipart import MIMEMultipart
 from mailman.config import config
+from mailman.interfaces.address import IEmailValidator
 from public import public
+from zope.component import getUtility
 
 
 COMMASPACE = ', '
@@ -96,13 +98,17 @@ class Message(email.message.Message):
 # Convert the header to str in case it's a Header instance.
 name, address = email.utils.parseaddr(str(field_value))
 senders.append(address.lower())
-# Filter out None and the empty string, and convert to unicode.
+# Filter out invalid addresses, None and the empty string, and convert
+# to unicode.
 clean_senders = []
+validator = getUtility(IEmailValidator)
 for sender in senders:
 if not sender:
 continue
 if isinstance(sender, bytes):
 sender = sender.decode('ascii')
+if not validator.is_valid(sender):
+continue
 clean_senders.append(sender)
 return clean_senders
 


=
src/mailman/runners/tests/test_incoming.py
=
--- a/src/mailman/runners/tests/test_incoming.py
+++ b/src/mailman/runners/tests/test_incoming.py
@@ -69,6 +69,17 @@ To: t...@example.com
 items = get_queue_messages('out', expected_count=1)
 self.assertEqual(items[0].msgdata.get('marker'), 'posting')
 
+def test_posting_from_invalid(self):
+# A message posted to the list goes through the posting chain even if
+# From: is invalid.
+del self._msg['from']
+self._msg['From'] = 'a...@example.com.'
+msgdata = dict(listid='test.example.com')
+config.switchboards['in'].enqueue(self._msg, msgdata)
+self._in.run()
+items = get_queue_messages('out', expected_count=1)
+self.assertEqual(items[0].msgdata.get('marker'), 'posting')
+
 def test_owner(self):
 # A message posted to the list goes through the posting chain.
 msgdata = dict(listid='test.example.com',



View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/8f8e4f0b1075a176892d3a74dd601cefc642a870...5b7eeedd19ac69976b38aec1132b1f23d963938d

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/8f8e4f0b1075a176892d3a74dd601cefc642a870...5b7eeedd19ac69976b38aec1132b1f23d963938d
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman] Pushed new branch listmanager

2017-06-24 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed new branch listmanager at mailman / Mailman

---
View it on GitLab: https://gitlab.com/mailman/mailman/tree/listmanager
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][click-cli] Make `mailman version` the same as `mailman --version`.

2017-06-23 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch click-cli at mailman / Mailman


Commits:
2005cb13 by Barry Warsaw at 2017-06-23T21:29:45-04:00
Make `mailman version` the same as `mailman --version`.

Convert status, version.

- - - - -


3 changed files:

- src/mailman/bin/mailman.py
- src/mailman/commands/cli_status.py
- src/mailman/commands/cli_version.py


Changes:

=
src/mailman/bin/mailman.py
=
--- a/src/mailman/bin/mailman.py
+++ b/src/mailman/bin/mailman.py
@@ -64,7 +64,7 @@ class Subcommands(click.MultiCommand):
 Configuration file to use.  If not given, the environment variable
 MAILMAN_CONFIG_FILE is consulted and used if set.  If neither are given, a
 default configuration file is loaded."""))
-@click.version_option(MAILMAN_VERSION_FULL)
+@click.version_option(MAILMAN_VERSION_FULL, message='%(version)s')
 @public
 def main(ctx, config_file):
 # XXX https://github.com/pallets/click/issues/303


=
src/mailman/commands/cli_status.py
=
--- a/src/mailman/commands/cli_status.py
+++ b/src/mailman/commands/cli_status.py
@@ -17,6 +17,8 @@
 
 """The `mailman status` subcommand."""
 
+import sys
+import click
 import socket
 
 from mailman.bin.master import WatcherState, master_state
@@ -26,34 +28,30 @@ from public import public
 from zope.interface import implementer
 
 
+@click.command(help=_('Status of the Mailman system'))
+def status():
+status, lock = master_state()
+if status is WatcherState.none:
+message = _('GNU Mailman is not running')
+elif status is WatcherState.conflict:
+hostname, pid, tempfile = lock.details
+message = _('GNU Mailman is running (master pid: $pid)')
+elif status is WatcherState.stale_lock:
+hostname, pid, tempfile = lock.details
+message = _('GNU Mailman is stopped (stale pid: $pid)')
+else:
+hostname, pid, tempfile = lock.details
+fqdn_name = socket.getfqdn() # noqa: F841
+assert status is WatcherState.host_mismatch, (
+'Invalid enum value: %s' % status)
+message = _('GNU Mailman is in an unexpected state '
+'($hostname != $fqdn_name)')
+print(message)
+sys.exit(status.value)
+
+
 @public
 @implementer(ICLISubCommand)
 class Status:
-"""Status of the Mailman system."""
-
 name = 'status'
-
-def add(self, parser, command_parser):
-"""See `ICLISubCommand`."""
-pass
-
-def process(self, args):
-"""See `ICLISubCommand`."""
-status, lock = master_state()
-if status is WatcherState.none:
-message = _('GNU Mailman is not running')
-elif status is WatcherState.conflict:
-hostname, pid, tempfile = lock.details
-message = _('GNU Mailman is running (master pid: $pid)')
-elif status is WatcherState.stale_lock:
-hostname, pid, tempfile = lock.details
-message = _('GNU Mailman is stopped (stale pid: $pid)')
-else:
-hostname, pid, tempfile = lock.details
-fqdn_name = socket.getfqdn() # noqa: F841
-assert status is WatcherState.host_mismatch, (
-'Invalid enum value: %s' % status)
-message = _('GNU Mailman is in an unexpected state '
-'($hostname != $fqdn_name)')
-print(message)
-return status.value
+command = status


=
src/mailman/commands/cli_version.py
=
--- a/src/mailman/commands/cli_version.py
+++ b/src/mailman/commands/cli_version.py
@@ -17,24 +17,22 @@
 
 """The Mailman version."""
 
+import click
+
+from mailman.core.i18n import _
 from mailman.interfaces.command import ICLISubCommand
 from mailman.version import MAILMAN_VERSION_FULL
 from public import public
 from zope.interface import implementer
 
 
+@click.command(help=_("Mailman's version"))
+def version():
+print(MAILMAN_VERSION_FULL)
+
+
 @public
 @implementer(ICLISubCommand)
 class Version:
-"""Mailman's version."""
-
 name = 'version'
-
-def add(self, parser, command_parser):
-"""See `ICLISubCommand`."""
-# No extra options.
-pass
-
-def process(self, args):
-"""See `ICLISubCommand`."""
-print(MAILMAN_VERSION_FULL)
+command = version



View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/2005cb13f95fd83910a864610c9aacbed97e0b21

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/2005cb13f95fd83910a864610c9aacbed97e0b21
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][click-cli] Make sure locale settings are passed through to the subprocess.

2017-06-17 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch click-cli at mailman / Mailman


Commits:
d72f2d9e by Barry Warsaw at 2017-06-17T20:31:59-07:00
Make sure locale settings are passed through to the subprocess.

- - - - -


1 changed file:

- src/mailman/bin/master.py


Changes:

=
src/mailman/bin/master.py
=
--- a/src/mailman/bin/master.py
+++ b/src/mailman/bin/master.py
@@ -44,6 +44,21 @@ SUBPROC_START_WAIT = timedelta(seconds=20)
 PRESERVE_ENVS = (
 'COVERAGE_PROCESS_START',
 'MAILMAN_EXTRA_TESTING_CFG',
+'LANG',
+'LANGUAGE',
+'LC_CTYPE',
+'LC_NUMERIC',
+'LC_TIME',
+'LC_COLLATE',
+'LC_MONETARY',
+'LC_MESSAGES',
+'LC_PAPER',
+'LC_NAME',
+'LC_ADDRESS',
+'LC_TELEPHONE',
+'LC_MEASUREMENT',
+'LC_IDENTIFICATION',
+'LC_ALL',
 )
 
 



View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/d72f2d9e87665795ada9c28fcf24bf11a697d32b

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/d72f2d9e87665795ada9c28fcf24bf11a697d32b
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman] Pushed new branch click-cli

2017-06-17 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed new branch click-cli at mailman / Mailman

---
View it on GitLab: https://gitlab.com/mailman/mailman/tree/click-cli
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman] Pushed new branch find-components

2017-06-15 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed new branch find-components at mailman / Mailman

---
View it on GitLab: https://gitlab.com/mailman/mailman/tree/find-components
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][master] Bump the code name.

2017-06-09 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch master at mailman / Mailman


Commits:
ccde1591 by Barry Warsaw at 2017-06-09T13:17:59-07:00
Bump the code name.

- - - - -


1 changed file:

- src/mailman/version.py


Changes:

=
src/mailman/version.py
=
--- a/src/mailman/version.py
+++ b/src/mailman/version.py
@@ -19,7 +19,7 @@
 
 # Mailman version.
 VERSION = '3.2.0a1'
-CODENAME = 'Between The Wheels'
+CODENAME = 'La Villa Strangiato'
 
 # And as a hex number in the manner of PY_VERSION_HEX.
 ALPHA = 0xa



View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/ccde15919fe89cd47d9f57d79d3450eb85253fcb

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/ccde15919fe89cd47d9f57d79d3450eb85253fcb
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][release-3.1] Update version.

2017-06-09 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch release-3.1 at mailman / Mailman


Commits:
b4371f7d by Barry Warsaw at 2017-06-04T13:44:01-04:00
Update version.

- - - - -


1 changed file:

- src/mailman/version.py


Changes:

=
src/mailman/version.py
=
--- a/src/mailman/version.py
+++ b/src/mailman/version.py
@@ -18,7 +18,7 @@
 """Mailman version strings."""
 
 # Mailman version.
-VERSION = '3.1.0+'
+VERSION = '3.1.1a1'
 CODENAME = 'Between The Wheels'
 
 # And as a hex number in the manner of PY_VERSION_HEX.



View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/b4371f7d828636cfcd154251648931d62d9fdc35

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/b4371f7d828636cfcd154251648931d62d9fdc35
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][release-3.1] Post release version bump.

2017-06-04 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch release-3.1 at mailman / Mailman


Commits:
fff6287a by Barry Warsaw at 2017-06-04T12:16:51-04:00
Post release version bump.

- - - - -


2 changed files:

- src/mailman/docs/NEWS.rst
- src/mailman/version.py


Changes:

=
src/mailman/docs/NEWS.rst
=
--- a/src/mailman/docs/NEWS.rst
+++ b/src/mailman/docs/NEWS.rst
@@ -8,6 +8,11 @@ Copyright (C) 1998-2017 by the Free Software Foundation, Inc.
 Here is a history of user visible changes to Mailman.
 
 
+3.1.1
+=
+(201X-XX-XXX)
+
+
 3.1.0 -- "Between The Wheels"
 =
 (2017-05-25)


=
src/mailman/version.py
=
--- a/src/mailman/version.py
+++ b/src/mailman/version.py
@@ -18,7 +18,7 @@
 """Mailman version strings."""
 
 # Mailman version.
-VERSION = '3.1.0'
+VERSION = '3.1.0+'
 CODENAME = 'Between The Wheels'
 
 # And as a hex number in the manner of PY_VERSION_HEX.
@@ -31,8 +31,8 @@ FINAL = 0xf
 
 MAJOR_REV = 3
 MINOR_REV = 1
-MICRO_REV = 0
-REL_LEVEL = FINAL
+MICRO_REV = 1
+REL_LEVEL = ALPHA
 # At most 15 beta releases!
 REL_SERIAL = 0
 



View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/fff6287a09d1b870cf31b159e61646d959d0293b

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/commit/fff6287a09d1b870cf31b159e61646d959d0293b
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman] Deleted branch 337-old-references-to-the-welcome-and-goodbye-templates

2017-05-28 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw deleted branch 
337-old-references-to-the-welcome-and-goodbye-templates at mailman / Mailman

---

You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman] Pushed new branch release-3.1

2017-05-28 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed new branch release-3.1 at mailman / Mailman

---
View it on GitLab: https://gitlab.com/mailman/mailman/tree/release-3.1
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman] Pushed new tag 3.1.0

2017-05-25 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed new tag 3.1.0 at mailman / Mailman

---
View it on GitLab: https://gitlab.com/mailman/mailman/tree/3.1.0
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman] Deleted branch 3.1.0

2017-05-25 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw deleted branch 3.1.0 at mailman / Mailman

---

You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman][master] 2 commits: 3.1.0 final!

2017-05-25 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed to branch master at mailman / Mailman


Commits:
14058b9b by Barry Warsaw at 2017-05-25T14:51:52-07:00
3.1.0 final!

- - - - -
28dbc044 by Barry Warsaw at 2017-05-25T22:23:43+00:00
Merge branch 3.1.0 into master

3.1.0 final!

See merge request !285
- - - - -


2 changed files:

- src/mailman/docs/NEWS.rst
- src/mailman/version.py


Changes:

=
src/mailman/docs/NEWS.rst
=
--- a/src/mailman/docs/NEWS.rst
+++ b/src/mailman/docs/NEWS.rst
@@ -10,7 +10,7 @@ Here is a history of user visible changes to Mailman.
 
 3.1.0 -- "Between The Wheels"
 =
-(2017-XX-XX)
+(2017-05-25)
 
 Bugs
 


=
src/mailman/version.py
=
--- a/src/mailman/version.py
+++ b/src/mailman/version.py
@@ -18,7 +18,7 @@
 """Mailman version strings."""
 
 # Mailman version.
-VERSION = '3.1.0rc2'
+VERSION = '3.1.0'
 CODENAME = 'Between The Wheels'
 
 # And as a hex number in the manner of PY_VERSION_HEX.
@@ -32,9 +32,9 @@ FINAL = 0xf
 MAJOR_REV = 3
 MINOR_REV = 1
 MICRO_REV = 0
-REL_LEVEL = GAMMA
+REL_LEVEL = FINAL
 # At most 15 beta releases!
-REL_SERIAL = 2
+REL_SERIAL = 0
 
 HEX_VERSION = ((MAJOR_REV << 24) | (MINOR_REV << 16) | (MICRO_REV << 8) |
(REL_LEVEL << 4)  | (REL_SERIAL << 0)) # noqa: E221



View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/069e393512ec87da50ed0cca767f433a9358bbb0...28dbc044a0d0c464c6800df6b5e27e2b25025b8d

---
View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/069e393512ec87da50ed0cca767f433a9358bbb0...28dbc044a0d0c464c6800df6b5e27e2b25025b8d
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman] Pushed new branch 3.1.0

2017-05-25 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw pushed new branch 3.1.0 at mailman / Mailman

---
View it on GitLab: https://gitlab.com/mailman/mailman/tree/3.1.0
You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



[Mailman-checkins] [Git][mailman/mailman] Deleted branch rc2

2017-05-25 Thread Barry Warsaw via Mailman-checkins
Barry Warsaw deleted branch rc2 at mailman / Mailman

---

You're receiving this email because of your account on gitlab.com.
___
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org



  1   2   3   >