From a9a41b54c7edb8c81d5f44f0b95373b682bc2499 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Thu, 1 Jun 2017 11:02:21 -0700 Subject: py3k: remove basestring and unicode. This probably isn't completely right, but it's a start. --- alot/db/envelope.py | 2 +- alot/db/manager.py | 2 +- alot/db/utils.py | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'alot/db') diff --git a/alot/db/envelope.py b/alot/db/envelope.py index 017dbaa4..bb440a00 100644 --- a/alot/db/envelope.py +++ b/alot/db/envelope.py @@ -155,7 +155,7 @@ class Envelope(object): if isinstance(attachment, Attachment): self.attachments.append(attachment) - elif isinstance(attachment, basestring): + elif isinstance(attachment, str): path = os.path.expanduser(attachment) part = helper.mimewrap(path, filename, ctype) self.attachments.append(Attachment(part)) diff --git a/alot/db/manager.py b/alot/db/manager.py index 93a38b81..2803d1d6 100644 --- a/alot/db/manager.py +++ b/alot/db/manager.py @@ -195,7 +195,7 @@ class DBManager(object): except (XapianError, NotmuchError) as e: logging.exception(e) self.writequeue.appendleft(current_item) - raise DatabaseError(unicode(e)) + raise DatabaseError(str(e)) except DatabaseLockedError as e: logging.debug('index temporarily locked') self.writequeue.appendleft(current_item) diff --git a/alot/db/utils.py b/alot/db/utils.py index f57d62bd..39bd9007 100644 --- a/alot/db/utils.py +++ b/alot/db/utils.py @@ -403,11 +403,12 @@ def decode_header(header, normalize=False): :type header: str :param normalize: replace trailing spaces after newlines :type normalize: bool - :rtype: unicode + :rtype: str """ # If the value isn't ascii as RFC2822 prescribes, # we just return the unicode bytestring as is + # XXX: this prbably isn't going to work in python 3 value = string_decode(header) # convert to unicode try: value = value.encode('ascii') -- cgit v1.2.3