Fix problem with gmail attachments
Showing 1 of 1 files from the diff.
gluon/tools.py
changed.
@@ -246,15 +246,13 @@
Loading
246 | 246 | if filename is None: |
|
247 | 247 | raise Exception('Missing attachment name') |
|
248 | 248 | payload = payload.read() |
|
249 | - | # FIXME PY3 can be used to_native? |
|
250 | - | filename = filename.encode(encoding) |
|
251 | 249 | if content_type is None: |
|
252 | 250 | content_type = contenttype(filename) |
|
253 | 251 | self.my_filename = filename |
|
254 | 252 | self.my_payload = payload |
|
255 | 253 | MIMEBase.__init__(self, *content_type.split('/', 1)) |
|
256 | 254 | self.set_payload(payload) |
|
257 | - | self['Content-Disposition'] = Header('attachment; filename="%s"' % to_native(filename, encoding), 'utf-8') |
|
255 | + | self.add_header('Content-Disposition', 'attachment', filename=filename) |
|
258 | 256 | if content_id is not None: |
|
259 | 257 | self['Content-Id'] = '<%s>' % to_native(content_id, encoding) |
|
260 | 258 | Encoders.encode_base64(self) |
Files | Coverage |
---|---|
gluon | 42.12% |
Project Totals (43 files) | 42.12% |
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file.
The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files.
The size and color of each slice is representing the number of statements and the coverage, respectively.