patchbomb: use native strings when determining attachment disposition
Differential Revision: https://phab.mercurial-scm.org/D4232
--- 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'))