diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2017-06-01 11:02:21 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2018-03-01 10:34:56 -0800 |
commit | a9a41b54c7edb8c81d5f44f0b95373b682bc2499 (patch) | |
tree | 7d97115f5a119276241b33eb1b0f835040165c24 /alot/db | |
parent | 0b0164b8daeb58fa576c82722a9514dba2e4acac (diff) |
py3k: remove basestring and unicode.
This probably isn't completely right, but it's a start.
Diffstat (limited to 'alot/db')
-rw-r--r-- | alot/db/envelope.py | 2 | ||||
-rw-r--r-- | alot/db/manager.py | 2 | ||||
-rw-r--r-- | alot/db/utils.py | 3 |
3 files changed, 4 insertions, 3 deletions
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') |