patchbomb: use native strings when determining attachment disposition
authorAugie Fackler <augie@google.com>
Thu, 09 Aug 2018 21:57:46 -0400
changeset 39038 2161faf0d24b
parent 39037 ede768cfe83e
child 39039 952bf3c948f0
patchbomb: use native strings when determining attachment disposition Differential Revision: https://phab.mercurial-scm.org/D4232
hgext/patchbomb.py
--- a/hgext/patchbomb.py	Thu Aug 09 21:04:15 2018 -0400
+++ b/hgext/patchbomb.py	Thu Aug 09 21:57:46 2018 -0400
@@ -278,10 +278,11 @@
                                                  seqno=idx, total=total)
             else:
                 patchname = cmdutil.makefilename(repo[node], '%b.patch')
-        disposition = 'inline'
+        disposition = r'inline'
         if opts.get('attach'):
-            disposition = 'attachment'
-        p['Content-Disposition'] = disposition + '; filename=' + patchname
+            disposition = r'attachment'
+        p[r'Content-Disposition'] = (
+            disposition + r'; filename=' + encoding.strfromlocal(patchname))
         msg.attach(p)
     else:
         msg = mail.mimetextpatch(body, display=opts.get('test'))