[Python-modules-commits] [django-anymail] 01/01: Upload to unstable (See #859306)
Scott Kitterman
kitterman at moszumanska.debian.org
Sat Apr 22 20:08:05 UTC 2017
This is an automated email from the git hooks/post-receive script.
kitterman pushed a commit to branch master
in repository django-anymail.
commit cca1af660de33aa16a1e42a3f9edfba71d3180da
Author: Scott Kitterman <scott at kitterman.com>
Date: Sat Apr 22 15:44:47 2017 -0400
Upload to unstable (See #859306)
* Upload to unstable (See #859306)
* Cherry pick debian/patches/fix-attachment-crash from upstream to prevent
tracebacks when when sending rfc822 messages as attachments (Upstream
issue https://github.com/anymail/django-anymail/pull/59)
---
debian/changelog | 9 +++++++++
debian/patches/fix-attachment-crash | 24 ++++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 34 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 314842d..862e217 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+django-anymail (0.8-2) unstable; urgency=medium
+
+ * Upload to unstable (See #859306)
+ * Cherry pick debian/patches/fix-attachment-crash from upstream to prevent
+ tracebacks when when sending rfc822 messages as attachments (Upstream
+ issue https://github.com/anymail/django-anymail/pull/59)
+
+ -- Scott Kitterman <scott at kitterman.com> Sat, 22 Apr 2017 15:41:48 -0400
+
django-anymail (0.8-1) experimental; urgency=medium
* New upstream release
diff --git a/debian/patches/fix-attachment-crash b/debian/patches/fix-attachment-crash
new file mode 100644
index 0000000..6f53b40
--- /dev/null
+++ b/debian/patches/fix-attachment-crash
@@ -0,0 +1,24 @@
+7d7448011b961b742ab053f29e265a554eff8297
+ anymail/utils.py | 6 ++++++
+ tests/test_mailgun_backend.py | 26 ++++++++++++++++++++++++--
+ tests/utils.py | 3 +++
+ 3 files changed, 33 insertions(+), 2 deletions(-)
+Note: Test changes not included for simplicity (not run during package build
+anyway).
+diff --git a/anymail/utils.py b/anymail/utils.py
+index 66c307a..f9e71ad 100644
+--- a/anymail/utils.py
++++ b/anymail/utils.py
+@@ -171,6 +171,12 @@ class Attachment(object):
+ if isinstance(attachment, MIMEBase):
+ self.name = attachment.get_filename()
+ self.content = attachment.get_payload(decode=True)
++ if self.content is None:
++ if hasattr(attachment, 'as_bytes'):
++ self.content = attachment.as_bytes()
++ else:
++ # Python 2.7 fallback
++ self.content = attachment.as_string().encode(self.encoding)
+ self.mimetype = attachment.get_content_type()
+
+ if get_content_disposition(attachment) == 'inline':
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..5f1a3f7
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+fix-attachment-crash
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/django-anymail.git
More information about the Python-modules-commits
mailing list