Skip to content
New issue

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

sending with attachments not working #19

Closed
aerickson opened this issue Feb 24, 2018 · 0 comments
Closed

sending with attachments not working #19

aerickson opened this issue Feb 24, 2018 · 0 comments

Comments

@aerickson
Copy link
Contributor

aerickson commented Feb 24, 2018

I get an error when attempting to send attachments when running from 7bb76b3 (head of the develop branch).

Sending with attachments does work at dd15a0a.

I'm running Python 3.6.4. Here's the error I'm getting:

(my code is above this point in the stack)
...
08:45:44 web.1  |   File "/Users/aje/git/inqqqq/venv/src/flask-mailgun3/flask_mailgun/core.py", line 51, in send
08:45:44 web.1  |     return self.mailgun_api.send(message)
08:45:44 web.1  |   File "/Users/aje/git/inqqqq/venv/src/flask-mailgun3/flask_mailgun/api.py", line 80, in send
08:45:44 web.1  |     files=files)
08:45:44 web.1  |   File "/Users/aje/git/inqqqq/venv/lib/python3.6/site-packages/requests/api.py", line 112, in post
08:45:44 web.1  |     return request('post', url, data=data, json=json, **kwargs)
08:45:44 web.1  |   File "/Users/aje/git/inqqqq/venv/lib/python3.6/site-packages/requests/api.py", line 58, in request
08:45:44 web.1  |     return session.request(method=method, url=url, **kwargs)
08:45:44 web.1  |   File "/Users/aje/git/inqqqq/venv/lib/python3.6/site-packages/requests/sessions.py", line 494, in request
08:45:44 web.1  |     prep = self.prepare_request(req)
08:45:44 web.1  |   File "/Users/aje/git/inqqqq/venv/lib/python3.6/site-packages/requests/sessions.py", line 437, in prepare_request
08:45:44 web.1  |     hooks=merge_hooks(request.hooks, self.hooks),
08:45:44 web.1  |   File "/Users/aje/git/inqqqq/venv/lib/python3.6/site-packages/requests/models.py", line 308, in prepare
08:45:44 web.1  |     self.prepare_body(data, files, json)
08:45:44 web.1  |   File "/Users/aje/git/inqqqq/venv/lib/python3.6/site-packages/requests/models.py", line 496, in prepare_body
08:45:44 web.1  |     (body, content_type) = self._encode_files(files, data)
08:45:44 web.1  |   File "/Users/aje/git/inqqqq/venv/lib/python3.6/site-packages/requests/models.py", line 162, in _encode_files
08:45:44 web.1  |     rf.make_multipart(content_type=ft)
08:45:44 web.1  |   File "/Users/aje/git/inqqqq/venv/lib/python3.6/site-packages/urllib3/fields.py", line 174, in make_multipart
08:45:44 web.1  |     (('name', self._name), ('filename', self._filename))
08:45:44 web.1  |   File "/Users/aje/git/inqqqq/venv/lib/python3.6/site-packages/urllib3/fields.py", line 134, in _render_parts
08:45:44 web.1  |     parts.append(self._render_part(name, value))
08:45:44 web.1  |   File "/Users/aje/git/inqqqq/venv/lib/python3.6/site-packages/urllib3/fields.py", line 114, in _render_part
08:45:44 web.1  |     return format_header_param(name, value)
08:45:44 web.1  |   File "/Users/aje/git/inqqqq/venv/lib/python3.6/site-packages/urllib3/fields.py", line 35, in format_header_param
08:45:44 web.1  |     if not any(ch in value for ch in '"\\\r\n'):
08:45:44 web.1  |   File "/Users/aje/git/inqqqq/venv/lib/python3.6/site-packages/urllib3/fields.py", line 35, in <genexpr>
08:45:44 web.1  |     if not any(ch in value for ch in '"\\\r\n'):
08:45:44 web.1  | TypeError: a bytes-like object is required, not 'str'
aerickson added a commit to aerickson/Flask-MailGun that referenced this issue Feb 24, 2018
Squashed commit of the following:

commit fd2f58e
Author: Andrew Erickson <aerickson@gmail.com>
Date:   Sat Feb 24 01:35:01 2018 -0800

    fix amey-sam#19
aerickson added a commit to aerickson/Flask-MailGun that referenced this issue Apr 22, 2018
Squashed commit of the following:

commit fd2f58e
Author: Andrew Erickson <aerickson@gmail.com>
Date:   Sat Feb 24 01:35:01 2018 -0800

    fix amey-sam#19
aerickson added a commit to aerickson/Flask-MailGun that referenced this issue Jul 30, 2018
Squashed commit of the following:

commit fd2f58e
Author: Andrew Erickson <aerickson@gmail.com>
Date:   Sat Feb 24 01:35:01 2018 -0800

    fix amey-sam#19

//// Powered by gbit (git branch integration tool).
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

No branches or pull requests

1 participant