diff options
author | Patrick Totzke <patricktotzke@gmail.com> | 2017-08-20 09:50:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-20 09:50:26 +0100 |
commit | 762b7dc1a60dc322876c6b5fa8769037c483eba0 (patch) | |
tree | 464f9eae7f5c6bd7804559671ced1fbcf459cddd /alot/commands | |
parent | 568508ad55ee8d5b48d8465b2887e5749074b73d (diff) | |
parent | e36db1f99d0797f2b984e74fe2f14dafdecb7d39 (diff) |
Merge pull request #1129 from dcbaker/submit/py3k-small-fixes
py3k small fixes
Diffstat (limited to 'alot/commands')
-rw-r--r-- | alot/commands/__init__.py | 2 | ||||
-rw-r--r-- | alot/commands/envelope.py | 10 | ||||
-rw-r--r-- | alot/commands/globals.py | 2 | ||||
-rw-r--r-- | alot/commands/thread.py | 10 | ||||
-rw-r--r-- | alot/commands/utils.py | 2 |
5 files changed, 13 insertions, 13 deletions
diff --git a/alot/commands/__init__.py b/alot/commands/__init__.py index 351fc993..0638926a 100644 --- a/alot/commands/__init__.py +++ b/alot/commands/__init__.py @@ -167,7 +167,7 @@ def commandfactory(cmdline, mode='global'): try: args = split_commandstring(cmdline) except ValueError as e: - raise CommandParseError(e.message) + raise CommandParseError(str(e)) args = [string_decode(x, 'utf-8') for x in args] logging.debug('ARGS: %s', args) cmdname = args[0] diff --git a/alot/commands/envelope.py b/alot/commands/envelope.py index b9ff51d6..4d2963ee 100644 --- a/alot/commands/envelope.py +++ b/alot/commands/envelope.py @@ -146,8 +146,8 @@ class SaveCommand(Command): ui.apply_command(globals.FlushCommand()) ui.apply_command(commands.globals.BufferCloseCommand()) except DatabaseError as e: - logging.error(e.message) - ui.notify('could not index message:\n%s' % e.message, + logging.error(e) + ui.notify('could not index message:\n%s' % e, priority='error', block=True) else: @@ -217,7 +217,7 @@ class SendCommand(Command): self.mail = email_as_string(self.mail) except GPGProblem as e: ui.clear_notify([clearme]) - ui.notify(e.message, priority='error') + ui.notify(str(e), priority='error') return ui.clear_notify([clearme]) @@ -499,7 +499,7 @@ class SignCommand(Command): sign=True) except GPGProblem as e: envelope.sign = False - ui.notify(e.message, priority='error') + ui.notify(str(e), priority='error') return else: try: @@ -571,7 +571,7 @@ class EncryptCommand(Command): tmp_key = crypto.get_key(keyid) del envelope.encrypt_keys[tmp_key.fpr] except GPGProblem as e: - ui.notify(e.message, priority='error') + ui.notify(str(e), priority='error') if not envelope.encrypt_keys: envelope.encrypt = False ui.current_buffer.rebuild() diff --git a/alot/commands/globals.py b/alot/commands/globals.py index 5f9faa3d..b71376a2 100644 --- a/alot/commands/globals.py +++ b/alot/commands/globals.py @@ -12,7 +12,7 @@ import glob import logging import os import subprocess -from StringIO import StringIO +from io import StringIO import urwid from twisted.internet.defer import inlineCallbacks diff --git a/alot/commands/thread.py b/alot/commands/thread.py index acbb4e28..02017ae9 100644 --- a/alot/commands/thread.py +++ b/alot/commands/thread.py @@ -14,7 +14,7 @@ from email.utils import getaddresses, parseaddr, formataddr from email.message import Message from twisted.internet.defer import inlineCallbacks -from cStringIO import StringIO +from io import BytesIO from . import Command, registerCommand from .globals import ExternalCommand @@ -186,7 +186,7 @@ class ReplyCommand(Command): try: from_header, _ = determine_sender(mail, 'reply') except AssertionError as e: - ui.notify(e.message, priority='error') + ui.notify(str(e), priority='error') return envelope.add('From', from_header) @@ -394,7 +394,7 @@ class ForwardCommand(Command): try: from_header, _ = determine_sender(mail, 'reply') except AssertionError as e: - ui.notify(e.message, priority='error') + ui.notify(str(e), priority='error') return envelope.add('From', from_header) @@ -441,7 +441,7 @@ class BounceMailCommand(Command): try: resent_from_header, account = determine_sender(mail, 'bounce') except AssertionError as e: - ui.notify(e.message, priority='error') + ui.notify(str(e), priority='error') return mail['Resent-From'] = resent_from_header @@ -970,7 +970,7 @@ class OpenAttachmentCommand(Command): def afterwards(): os.unlink(tempfile_name) else: - handler_stdin = StringIO() + handler_stdin = BytesIO() self.attachment.write(handler_stdin) # create handler command list diff --git a/alot/commands/utils.py b/alot/commands/utils.py index 0aa80656..1bf64cbb 100644 --- a/alot/commands/utils.py +++ b/alot/commands/utils.py @@ -86,7 +86,7 @@ def _get_keys(ui, encrypt_keyids, block_error=False, signed_only=False): encrypt_keyids.append(keyid) continue else: - ui.notify(e.message, priority='error', block=block_error) + ui.notify(str(e), priority='error', block=block_error) continue keys[key.fpr] = key returnValue(keys) |