Skip to content

Fixed attachment type comparison problem#3

Closed
brimcfadden wants to merge 1 commit into
themartorana:masterfrom
brimcfadden:master
Closed

Fixed attachment type comparison problem#3
brimcfadden wants to merge 1 commit into
themartorana:masterfrom
brimcfadden:master

Conversation

@brimcfadden

Copy link
Copy Markdown
Contributor

While 99e2f70 introduced setup.py and "made attachments work," there was an error in the code.

I opened an issue (#2) which details the following error:

AttributeError: 'module' object has no attribute 'base'

You can see the whole stack trace on the issue page.

For some reason, the scope of the original import email doesn't allow that attribute to be seen. I've fixed the problem. I'm guessing that joshourisman was passing in tuples while testing (so the code never executed the statement isinstance(attachment, email.mime.base.MIMEBase), or else his version of Python is different from mine (which is 2.6.5 on Linux) and the email package is differs. Python packaging is still a bit enigmatic to me.

I also updated the docstring description for the attachments parameter, because it was wrong.

I am able to send e-mails with attachments using my edits. I didn't attempt to use MIMEBase objects because I haven't used them before and that doesn't seem like it would be an issue. You can close the issue I opened if you pull this commit.

…e.MIMEBase and changed the docstring to more accurately describe the nature of the attachments parameter.
@themartorana

Copy link
Copy Markdown
Owner

Fantastic - pulled. Thanks!!

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants