/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/email_message.py

  • Committer: Jelmer Vernooij
  • Date: 2018-08-25 01:32:37 UTC
  • mto: This revision was merged to the branch mainline in revision 7094.
  • Revision ID: jelmer@jelmer.uk-20180825013237-fkkom43r6oj56zza
Fix email tests on Python 3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
        )
34
34
    from email.Utils import formataddr, parseaddr
35
35
from . import __version__ as _breezy_version
 
36
from .errors import BzrBadParameterNotUnicode
36
37
from .osutils import safe_unicode
37
38
from .sixish import (
38
39
    text_type,
179
180
        :param address: An unicode string, or UTF-8 byte string.
180
181
        :return: A possibly RFC2047-encoded string.
181
182
        """
 
183
        if not isinstance(address,(str, text_type)):
 
184
            raise BzrBadParameterNotUnicode(address)
182
185
        # Can't call Header over all the address, because that encodes both the
183
186
        # name and the email address, which is not permitted by RFCs.
184
187
        user, email = parseaddr(address)