diff options
| author | Barry Warsaw | 2015-01-04 20:20:33 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2015-01-04 20:20:33 -0500 |
| commit | 4a612db8e89afed74173b93f3b64fa567b8417a3 (patch) | |
| tree | 81a687d113079a25f93279f35c7eee2aa2572510 /src/mailman/model/requests.py | |
| parent | 84af79988a4e916604cba31843778206efb7d1b8 (diff) | |
| parent | de181c1a40965a3a7deedd56a034a946f45b6984 (diff) | |
| download | mailman-4a612db8e89afed74173b93f3b64fa567b8417a3.tar.gz mailman-4a612db8e89afed74173b93f3b64fa567b8417a3.tar.zst mailman-4a612db8e89afed74173b93f3b64fa567b8417a3.zip | |
Diffstat (limited to 'src/mailman/model/requests.py')
| -rw-r--r-- | src/mailman/model/requests.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/mailman/model/requests.py b/src/mailman/model/requests.py index 6b130196d..9d9692b30 100644 --- a/src/mailman/model/requests.py +++ b/src/mailman/model/requests.py @@ -17,25 +17,25 @@ """Implementations of the pending requests interfaces.""" -from __future__ import absolute_import, print_function, unicode_literals - -__metaclass__ = type __all__ = [ + 'DataPendable', + 'ListRequests', ] -from cPickle import dumps, loads -from datetime import timedelta -from sqlalchemy import Column, ForeignKey, Integer, LargeBinary, Unicode -from sqlalchemy.orm import relationship -from zope.component import getUtility -from zope.interface import implementer +import six +from datetime import timedelta from mailman.database.model import Model from mailman.database.transaction import dbconnection from mailman.database.types import Enum from mailman.interfaces.pending import IPendable, IPendings from mailman.interfaces.requests import IListRequests, RequestType +from six.moves.cPickle import dumps, loads +from sqlalchemy import Column, ForeignKey, Integer, Unicode +from sqlalchemy.orm import relationship +from zope.component import getUtility +from zope.interface import implementer @@ -50,8 +50,8 @@ class DataPendable(dict): # such a way that it will be properly reconstituted when unpended. clean_mapping = {} for key, value in mapping.items(): - assert isinstance(key, basestring) - if not isinstance(value, unicode): + assert isinstance(key, six.string_types) + if not isinstance(value, six.text_type): key = '_pck_' + key value = dumps(value).decode('raw-unicode-escape') clean_mapping[key] = value @@ -154,7 +154,7 @@ class _Request(Model): id = Column(Integer, primary_key=True) key = Column(Unicode) request_type = Column(Enum(RequestType)) - data_hash = Column(LargeBinary) + data_hash = Column(Unicode) mailing_list_id = Column(Integer, ForeignKey('mailinglist.id'), index=True) mailing_list = relationship('MailingList') |
