# HG changeset patch # User Augie Fackler # Date 2018-08-10 01:57:46 # Node ID 2161faf0d24bbb0d4efc9a0aec0bfa1bd8aff8bd # Parent ede768cfe83eab20e649adb6daec42cb463816bd patchbomb: use native strings when determining attachment disposition Differential Revision: https://phab.mercurial-scm.org/D4232 diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py --- a/hgext/patchbomb.py +++ b/hgext/patchbomb.py @@ -278,10 +278,11 @@ def makepatch(ui, repo, rev, patchlines, 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'))