[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#859306: unblock: django-anymail/0.8-2



On Saturday, April 22, 2017 05:44:00 PM Niels Thykier wrote:
> Control: tags -1 confirmed
> 
> On Wed, 12 Apr 2017 15:04:41 -0400 Scott Kitterman
> 
> <debian@kitterman.com> wrote:
> > On Wednesday, April 12, 2017 08:33:57 PM Ivo De Decker wrote:
> > [...]
> > 
> > I recognize this request is outside the normal scope of what's accepted.
> > Given that the only purpose of this package is for integration with
> > external APIs and it's in contrib, I was hoping for an exception for this
> > case.
> > 
> > I hope that clarifies things.  If not, please let me know.
> > 
> > Scott K
> 
> Assuming that you are ready to roll-back to the current version if it
> turns out that there are problems beyond what trivial / targeted patches
> can fix from here, then please go ahead.
> 
> Please remove the moreinfo tag once the upload is in unstable and has
> been compiled on all relevant release architectures.

Thanks.  Reviewing the upstream activity since I filed this request, I found 
one bug fix worth cherry picking.  The attached debdiff (relative what's 
already approved) is what I'm about to upload.

It fixes an obvious error that is present both in testing and the new version, 
so it addresses an existing issue in stretch that's significant enough that 
I'd ask to do a stable pu to fix it if stretch had already released and 
addresses the issue a way that the risk of regression is essentially zero.

If the release team concludes they'd rather not have this fix in stretch, 
please let me know and I'll upload again without it (I'm going ahead to save a 
round trip since it seems reasonably obviously a good idea).

Scott K
diff -Nru django-anymail-0.8/debian/changelog django-anymail-0.8/debian/changelog
--- django-anymail-0.8/debian/changelog	2017-04-01 16:38:55.000000000 -0400
+++ django-anymail-0.8/debian/changelog	2017-04-22 15:43:39.000000000 -0400
@@ -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@kitterman.com>  Sat, 22 Apr 2017 15:41:48 -0400
+
 django-anymail (0.8-1) experimental; urgency=medium
 
   * New upstream release
diff -Nru django-anymail-0.8/debian/patches/fix-attachment-crash django-anymail-0.8/debian/patches/fix-attachment-crash
--- django-anymail-0.8/debian/patches/fix-attachment-crash	1969-12-31 19:00:00.000000000 -0500
+++ django-anymail-0.8/debian/patches/fix-attachment-crash	2017-04-22 15:40:59.000000000 -0400
@@ -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 -Nru django-anymail-0.8/debian/patches/series django-anymail-0.8/debian/patches/series
--- django-anymail-0.8/debian/patches/series	1969-12-31 19:00:00.000000000 -0500
+++ django-anymail-0.8/debian/patches/series	2017-04-22 14:22:11.000000000 -0400
@@ -0,0 +1 @@
+fix-attachment-crash

Reply to: