We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
str
>>> from marrow.mailer import Mailer, Message >>> mailer = Mailer({'transport': {'use': 'smtp', 'tls': 'no', 'host': 'mail.tiptoe.de'}}) >>> msg = Message(author='[email protected]', to='[email protected]', subject='Test') >>> mailer.start(); mailer.send(msg); mailer.stop() <[email protected]> DEFERRED AttributeError Traceback (most recent call last): File "/home/nils/.virtualenvs/igl-py3k/lib/python3.4/site-packages/marrow/mailer/transport/smtp.py", line 115, in send_with_smtp recipients = [addr.decode('utf-8') for addr in message.recipients.string_addresses] File "/home/nils/.virtualenvs/igl-py3k/lib/python3.4/site-packages/marrow/mailer/transport/smtp.py", line 115, in <listcomp> recipients = [addr.decode('utf-8') for addr in message.recipients.string_addresses] AttributeError: 'str' object has no attribute 'decode' Mailer(manager=ImmediateManager, transport=SMTPTransport)
The code assumes an UTF-8 encoded, Python 2 str object which needs to be decoded into a unicode object. In Python 3, this is unnecessary.
unicode
The text was updated successfully, but these errors were encountered:
py3k: don't attempt to decode str objects
1e00fc7
Python 3 `str` objects are Unicode already and don't need decoding. marrow#59
how to solve this in py3 ?
Sorry, something went wrong.
This was likely resolved long, long ago, with a PR from Nando.
No branches or pull requests
The code assumes an UTF-8 encoded, Python 2
str
object which needs to be decoded into aunicode
object. In Python 3, this is unnecessary.The text was updated successfully, but these errors were encountered: