diff options
| author | Barry Warsaw | 2016-01-26 15:32:19 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2016-01-26 15:32:19 -0500 |
| commit | 802ce668e67f51f904c69fdab2f5565a73c15e8a (patch) | |
| tree | 8ec85559627422b0b13b520cacdc8a776aeee640 | |
| parent | 57a07393e984dbbc356bc05f0c6801ffe1536b47 (diff) | |
| download | mailman-802ce668e67f51f904c69fdab2f5565a73c15e8a.tar.gz mailman-802ce668e67f51f904c69fdab2f5565a73c15e8a.tar.zst mailman-802ce668e67f51f904c69fdab2f5565a73c15e8a.zip | |
30 files changed, 42 insertions, 68 deletions
diff --git a/src/mailman/app/bounces.py b/src/mailman/app/bounces.py index bfc913da3..acd1a740b 100644 --- a/src/mailman/app/bounces.py +++ b/src/mailman/app/bounces.py @@ -146,7 +146,7 @@ class _BaseVERPParser: class StandardVERP(_BaseVERPParser): def __init__(self): - super(StandardVERP, self).__init__(config.mta.verp_regexp) + super().__init__(config.mta.verp_regexp) def _get_address(self, match_object): return '{0}@{1}'.format(*match_object.group('local', 'domain')) @@ -154,7 +154,7 @@ class StandardVERP(_BaseVERPParser): class ProbeVERP(_BaseVERPParser): def __init__(self): - super(ProbeVERP, self).__init__(config.mta.verp_probe_regexp) + super().__init__(config.mta.verp_probe_regexp) def _get_address(self, match_object): # Extract the token and get the matching address. diff --git a/src/mailman/chains/headers.py b/src/mailman/chains/headers.py index f0275ca15..a952c4ffd 100644 --- a/src/mailman/chains/headers.py +++ b/src/mailman/chains/headers.py @@ -104,7 +104,7 @@ class HeaderMatchChain(Chain): """ def __init__(self): - super(HeaderMatchChain, self).__init__( + super().__init__( 'header-match', _('The built-in header matching chain')) # This chain will dynamically calculate the links from the # configuration file, the database, and any explicitly added header diff --git a/src/mailman/compat/smtpd.py b/src/mailman/compat/smtpd.py index ff86e7d20..813624729 100755 --- a/src/mailman/compat/smtpd.py +++ b/src/mailman/compat/smtpd.py @@ -748,7 +748,7 @@ class PureProxy(SMTPServer): def __init__(self, *args, **kwargs): if 'enable_SMTPUTF8' in kwargs and kwargs['enable_SMTPUTF8']: raise ValueError("PureProxy does not support SMTPUTF8.") - super(PureProxy, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) def process_message(self, peer, mailfrom, rcpttos, data): lines = data.split('\n') @@ -793,7 +793,7 @@ class MailmanProxy(PureProxy): def __init__(self, *args, **kwargs): if 'enable_SMTPUTF8' in kwargs and kwargs['enable_SMTPUTF8']: raise ValueError("MailmanProxy does not support SMTPUTF8.") - super(PureProxy, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) def process_message(self, peer, mailfrom, rcpttos, data): from io import StringIO diff --git a/src/mailman/core/errors.py b/src/mailman/core/errors.py index a5d768aaa..c293e81cb 100644 --- a/src/mailman/core/errors.py +++ b/src/mailman/core/errors.py @@ -27,19 +27,10 @@ interfaces. __all__ = [ - 'AlreadyReceivingDigests', - 'AlreadyReceivingRegularDeliveries', - 'BadPasswordSchemeError', - 'CantDigestError', 'DiscardMessage', 'HandlerError', 'HoldMessage', 'LostHeldMessage', - 'MailmanError', - 'MailmanException', - 'MemberError', - 'MustDigestError', - 'PasswordError', 'RESTError', 'ReadOnlyPATCHRequestError', 'RejectMessage', @@ -101,22 +92,6 @@ class RejectMessage(HandlerError): -class PasswordError(MailmanError): - """A password related error.""" - - -class BadPasswordSchemeError(PasswordError): - """A bad password scheme was given.""" - - def __init__(self, scheme_name='unknown'): - super(BadPasswordSchemeError, self).__init__() - self.scheme_name = scheme_name - - def __str__(self): - return 'A bad password scheme was given: %s' % self.scheme_name - - - class RESTError(MailmanError): """Base class for REST API errors.""" diff --git a/src/mailman/database/postgresql.py b/src/mailman/database/postgresql.py index 693e7c925..a83119f66 100644 --- a/src/mailman/database/postgresql.py +++ b/src/mailman/database/postgresql.py @@ -37,7 +37,7 @@ class PostgreSQLDatabase(SABaseDatabase): Reset the <tablename>_id_seq.last_value so that primary key ids restart from zero for new tests. """ - super(PostgreSQLDatabase, self)._post_reset(store) + super()._post_reset(store) tables = reversed(Model.metadata.sorted_tables) # Recipe adapted from # http://stackoverflow.com/questions/544791/ diff --git a/src/mailman/database/types.py b/src/mailman/database/types.py index c6926d0f2..66fbbf9e9 100644 --- a/src/mailman/database/types.py +++ b/src/mailman/database/types.py @@ -40,8 +40,8 @@ class Enum(TypeDecorator): impl = Integer def __init__(self, enum, *args, **kw): + super().__init__(*args, **kw) self.enum = enum - super(Enum, self).__init__(*args, **kw) def process_bind_param(self, value, dialect): if value is None: diff --git a/src/mailman/interfaces/address.py b/src/mailman/interfaces/address.py index 2d3e159a1..a21190a94 100644 --- a/src/mailman/interfaces/address.py +++ b/src/mailman/interfaces/address.py @@ -39,7 +39,7 @@ class EmailError(MailmanError): """A generic text email address-related error occurred.""" def __init__(self, email): - super(EmailError, self).__init__() + super().__init__() self.email = email def __str__(self): @@ -50,7 +50,7 @@ class AddressError(MailmanError): """A generic IAddress-related error occurred.""" def __init__(self, address): - super(AddressError, self).__init__() + super().__init__() self.address = address def __str__(self): diff --git a/src/mailman/interfaces/domain.py b/src/mailman/interfaces/domain.py index b8ffaecaf..25aa54cc3 100644 --- a/src/mailman/interfaces/domain.py +++ b/src/mailman/interfaces/domain.py @@ -37,7 +37,7 @@ class BadDomainSpecificationError(MailmanError): """The specification of a virtual domain is invalid or duplicated.""" def __init__(self, domain): - super(BadDomainSpecificationError, self).__init__(domain) + super().__init__(domain) self.domain = domain diff --git a/src/mailman/interfaces/member.py b/src/mailman/interfaces/member.py index 15af882c8..f084391e2 100644 --- a/src/mailman/interfaces/member.py +++ b/src/mailman/interfaces/member.py @@ -109,7 +109,7 @@ class AlreadySubscribedError(MembershipError): """The member is already subscribed to the mailing list with this role.""" def __init__(self, fqdn_listname, email, role): - super(AlreadySubscribedError, self).__init__() + super().__init__() self.fqdn_listname = fqdn_listname self.email = email self.role = role @@ -136,7 +136,7 @@ class MissingPreferredAddressError(MembershipError): """A user without a preferred address attempted to subscribe.""" def __init__(self, user): - super(MissingPreferredAddressError, self).__init__() + super().__init__() self._user = user def __str__(self): @@ -147,7 +147,7 @@ class NotAMemberError(MembershipError): """The address is not a member of the mailing list.""" def __init__(self, mlist, address): - super(NotAMemberError, self).__init__() + super().__init__() self._mlist = mlist self._address = address diff --git a/src/mailman/interfaces/mta.py b/src/mailman/interfaces/mta.py index a2af13bca..5cf9c79c4 100644 --- a/src/mailman/interfaces/mta.py +++ b/src/mailman/interfaces/mta.py @@ -32,7 +32,7 @@ from zope.interface import Interface class SomeRecipientsFailed(MailmanError): """Delivery to some or all recipients failed""" def __init__(self, temporary_failures, permanent_failures): - super(SomeRecipientsFailed, self).__init__() + super().__init__() self.temporary_failures = temporary_failures self.permanent_failures = permanent_failures diff --git a/src/mailman/model/address.py b/src/mailman/model/address.py index f243d976c..b632f54e1 100644 --- a/src/mailman/model/address.py +++ b/src/mailman/model/address.py @@ -55,7 +55,7 @@ class Address(Model): 'Preferences', backref=backref('address', uselist=False)) def __init__(self, email, display_name): - super(Address, self).__init__() + super().__init__() getUtility(IEmailValidator).validate(email) lower_case = email.lower() self.email = lower_case diff --git a/src/mailman/model/bans.py b/src/mailman/model/bans.py index 5894c1aef..a2a52a657 100644 --- a/src/mailman/model/bans.py +++ b/src/mailman/model/bans.py @@ -43,7 +43,7 @@ class Ban(Model): list_id = Column(Unicode, index=True) def __init__(self, email, list_id): - super(Ban, self).__init__() + super().__init__() self.email = email self.list_id = list_id diff --git a/src/mailman/model/mailinglist.py b/src/mailman/model/mailinglist.py index abc2c57f6..4160f6cc7 100644 --- a/src/mailman/model/mailinglist.py +++ b/src/mailman/model/mailinglist.py @@ -190,7 +190,7 @@ class MailingList(Model): welcome_message_uri = Column(Unicode) def __init__(self, fqdn_listname): - super(MailingList, self).__init__() + super().__init__() listname, at, hostname = fqdn_listname.partition('@') assert hostname, 'Bad list name: {0}'.format(fqdn_listname) self.list_name = listname @@ -511,7 +511,7 @@ class AcceptableAlias(Model): alias = Column(Unicode, index=True, nullable=False) def __init__(self, mailing_list, alias): - super(AcceptableAlias, self).__init__() + super().__init__() self.mailing_list = mailing_list self.alias = alias diff --git a/src/mailman/model/message.py b/src/mailman/model/message.py index 477d957c4..c0fb1cd37 100644 --- a/src/mailman/model/message.py +++ b/src/mailman/model/message.py @@ -44,7 +44,7 @@ class Message(Model): @dbconnection def __init__(self, store, message_id, message_id_hash, path): - super(Message, self).__init__() + super().__init__() self.message_id = message_id self.message_id_hash = message_id_hash self.path = path diff --git a/src/mailman/model/requests.py b/src/mailman/model/requests.py index 831674aa1..83120e182 100644 --- a/src/mailman/model/requests.py +++ b/src/mailman/model/requests.py @@ -56,7 +56,7 @@ class DataPendable(dict): key = '_pck_' + key value = dumps(value).decode('raw-unicode-escape') clean_mapping[key] = value - super(DataPendable, self).update(clean_mapping) + super().update(clean_mapping) @@ -159,7 +159,7 @@ class _Request(Model): mailing_list = relationship('MailingList') def __init__(self, key, request_type, mailing_list, data_hash): - super(_Request, self).__init__() + super().__init__() self.key = key self.request_type = request_type self.mailing_list = mailing_list diff --git a/src/mailman/model/user.py b/src/mailman/model/user.py index bc99ca327..7d74df7a9 100644 --- a/src/mailman/model/user.py +++ b/src/mailman/model/user.py @@ -78,7 +78,7 @@ class User(Model): @dbconnection def __init__(self, store, display_name=None, preferences=None): - super(User, self).__init__() + super().__init__() self._created_on = date_factory.now() user_id = uid_factory.new() assert store.query(User).filter_by(_user_id=user_id).count() == 0, ( diff --git a/src/mailman/mta/base.py b/src/mailman/mta/base.py index 2f4f64b47..43b737fb9 100644 --- a/src/mailman/mta/base.py +++ b/src/mailman/mta/base.py @@ -134,7 +134,7 @@ class IndividualDelivery(BaseDelivery): def __init__(self): """See `BaseDelivery`.""" - super(IndividualDelivery, self).__init__() + super().__init__() self.callbacks = [] def deliver(self, mlist, msg, msgdata): diff --git a/src/mailman/mta/bulk.py b/src/mailman/mta/bulk.py index 2e531e361..65dfea0bb 100644 --- a/src/mailman/mta/bulk.py +++ b/src/mailman/mta/bulk.py @@ -50,7 +50,7 @@ class BulkDelivery(BaseDelivery): big chunk. :type max_recipients: integer """ - super(BulkDelivery, self).__init__() + super().__init__() self._max_recipients = (max_recipients if max_recipients is not None else 0) diff --git a/src/mailman/mta/decorating.py b/src/mailman/mta/decorating.py index 205049a38..c0a1dc07b 100644 --- a/src/mailman/mta/decorating.py +++ b/src/mailman/mta/decorating.py @@ -45,5 +45,5 @@ class DecoratingDelivery(DecoratingMixin, VERPDelivery): def __init__(self): """See `IndividualDelivery`.""" - super(DecoratingDelivery, self).__init__() + super().__init__() self.callbacks.append(self.decorate) diff --git a/src/mailman/mta/deliver.py b/src/mailman/mta/deliver.py index bfc731f2e..034364da6 100644 --- a/src/mailman/mta/deliver.py +++ b/src/mailman/mta/deliver.py @@ -54,7 +54,7 @@ class Deliver(VERPMixin, DecoratingMixin, PersonalizedMixin, """ def __init__(self): - super(Deliver, self).__init__() + super().__init__() self.callbacks.extend([ self.avoid_duplicates, self.decorate, diff --git a/src/mailman/mta/personalized.py b/src/mailman/mta/personalized.py index 21ea1d1a7..5e573a599 100644 --- a/src/mailman/mta/personalized.py +++ b/src/mailman/mta/personalized.py @@ -69,5 +69,5 @@ class PersonalizedDelivery(PersonalizedMixin, VERPDelivery): def __init__(self): """See `IndividualDelivery`.""" - super(PersonalizedDelivery, self).__init__() + super().__init__() self.callbacks.append(self.personalize_to) diff --git a/src/mailman/mta/verp.py b/src/mailman/mta/verp.py index d0b33b3e0..b4de5474c 100644 --- a/src/mailman/mta/verp.py +++ b/src/mailman/mta/verp.py @@ -53,7 +53,7 @@ class VERPMixin: :param msgdata: Additional message metadata for this delivery. :type msgdata: dictionary """ - sender = super(VERPMixin, self)._get_sender(mlist, msg, msgdata) + sender = super()._get_sender(mlist, msg, msgdata) if msgdata.get('verp', False): log.debug('VERPing %s', msg.get('message-id')) recipient = msgdata['recipient'] @@ -96,5 +96,5 @@ class VERPDelivery(VERPMixin, IndividualDelivery): def __init__(self): """See `IndividualDelivery`.""" - super(VERPDelivery, self).__init__() + super().__init__() self.callbacks.append(self.avoid_duplicates) diff --git a/src/mailman/rest/helpers.py b/src/mailman/rest/helpers.py index 135d950ac..a29c0599b 100644 --- a/src/mailman/rest/helpers.py +++ b/src/mailman/rest/helpers.py @@ -254,12 +254,12 @@ class ChildError: class BadRequest(ChildError): def __init__(self): - super(BadRequest, self).__init__(falcon.HTTP_400) + super().__init__(falcon.HTTP_400) class NotFound(ChildError): def __init__(self): - super(NotFound, self).__init__(falcon.HTTP_404) + super().__init__(falcon.HTTP_404) def okay(response, body=None): diff --git a/src/mailman/rest/validator.py b/src/mailman/rest/validator.py index 35be36be4..6b708872a 100644 --- a/src/mailman/rest/validator.py +++ b/src/mailman/rest/validator.py @@ -180,4 +180,4 @@ class PatchValidator(Validator): if converters[attribute].decoder is None: raise ReadOnlyPATCHRequestError(attribute) validationators[attribute] = converters[attribute] - super(PatchValidator, self).__init__(**validationators) + super().__init__(**validationators) diff --git a/src/mailman/runners/bounce.py b/src/mailman/runners/bounce.py index a6d0f49b0..ba05b400d 100644 --- a/src/mailman/runners/bounce.py +++ b/src/mailman/runners/bounce.py @@ -37,7 +37,7 @@ class BounceRunner(Runner): """The bounce runner.""" def __init__(self, name, slice=None): - super(BounceRunner, self).__init__(name, slice) + super().__init__(name, slice) self._processor = getUtility(IBounceProcessor) def _dispose(self, mlist, msg, msgdata): diff --git a/src/mailman/runners/digest.py b/src/mailman/runners/digest.py index 357379e32..3d540d73f 100644 --- a/src/mailman/runners/digest.py +++ b/src/mailman/runners/digest.py @@ -151,7 +151,7 @@ class MIMEDigester(Digester): """A MIME digester.""" def __init__(self, mlist, volume, digest_number): - super(MIMEDigester, self).__init__(mlist, volume, digest_number) + super().__init__(mlist, volume, digest_number) masthead = MIMEText(self._masthead.encode(self._charset), _charset=self._charset) masthead['Content-Description'] = self._subject @@ -215,7 +215,7 @@ class RFC1153Digester(Digester): """A digester of the format specified by RFC 1153.""" def __init__(self, mlist, volume, digest_number): - super(RFC1153Digester, self).__init__(mlist, volume, digest_number) + super().__init__(mlist, volume, digest_number) self._separator70 = '-' * 70 self._separator30 = '-' * 30 self._text = StringIO() diff --git a/src/mailman/runners/lmtp.py b/src/mailman/runners/lmtp.py index 7f89bc4a9..3ec9e37c2 100644 --- a/src/mailman/runners/lmtp.py +++ b/src/mailman/runners/lmtp.py @@ -171,7 +171,7 @@ class LMTPRunner(Runner, smtpd.SMTPServer): qlog.debug('LMTP server listening on %s:%s', localaddr[0], localaddr[1]) smtpd.SMTPServer.__init__(self, localaddr, remoteaddr=None) - super(LMTPRunner, self).__init__(name, slice) + super().__init__(name, slice) def handle_accept(self): conn, addr = self.accept() diff --git a/src/mailman/runners/outgoing.py b/src/mailman/runners/outgoing.py index 5ffca2595..98c484e3f 100644 --- a/src/mailman/runners/outgoing.py +++ b/src/mailman/runners/outgoing.py @@ -54,7 +54,7 @@ class OutgoingRunner(Runner): """The outgoing runner.""" def __init__(self, slice=None, numslices=1): - super(OutgoingRunner, self).__init__(slice, numslices) + super().__init__(slice, numslices) # We look this function up only at startup time. self._func = find_name(config.mta.outgoing) # This prevents smtp server connection problems from filling up the diff --git a/src/mailman/runners/rest.py b/src/mailman/runners/rest.py index 6acc13df0..831f99997 100644 --- a/src/mailman/runners/rest.py +++ b/src/mailman/runners/rest.py @@ -41,7 +41,7 @@ class RESTRunner(Runner): def __init__(self, name, slice=None): """See `IRunner`.""" - super(RESTRunner, self).__init__(name, slice) + super().__init__(name, slice) # Both the REST server and the signal handlers must run in the main # thread; the former because of SQLite requirements (objects created # in one thread cannot be shared with the other threads), and the @@ -66,7 +66,7 @@ class RESTRunner(Runner): self._server.serve_forever() def signal_handler(self, signum, frame): - super(RESTRunner, self).signal_handler(signum, frame) + super().signal_handler(signum, frame) if signum in (signal.SIGTERM, signal.SIGINT, signal.SIGUSR1): # Set the flag that will terminate the TCPserver loop. self._event.set() diff --git a/src/mailman/testing/helpers.py b/src/mailman/testing/helpers.py index fa16c1f7f..2e3809f03 100644 --- a/src/mailman/testing/helpers.py +++ b/src/mailman/testing/helpers.py @@ -99,7 +99,7 @@ def make_testable_runner(runner_class, name=None, predicate=None): """Stop processing when the queue is empty.""" def __init__(self, *args, **kws): - super(EmptyingRunner, self).__init__(*args, **kws) + super().__init__(*args, **kws) # We know it's an EmptyingRunner, so really we want to see the # super class in the log files. self.__class__.__name__ = runner_class.__name__ @@ -166,8 +166,7 @@ class TestableMaster(Master): until the pass condition is set. :type start_check: Callable taking no arguments, returning nothing. """ - super(TestableMaster, self).__init__( - restartable=False, config_file=config.filename) + super().__init__(restartable=False, config_file=config.filename) self.start_check = start_check self.event = threading.Event() self.thread = threading.Thread(target=self.loop) @@ -215,7 +214,7 @@ class TestableMaster(Master): self.start_check() # Let the blocking thread know everything's running. self.event.set() - super(TestableMaster, self).loop() + super().loop() @property def runner_pids(self): |
