diff mercurial/mail.py @ 43096:813aa8cc55d4

patchbomb: use procutil.shellquote() instead of shlex to escape email address This basically backs out 2cc453284d5c, and inserts procutil.shellquote() instead. I don't care about Windows compatibility here, but shlex.quote() can't handle byte strings on Python 3.
author Yuya Nishihara <yuya@tcha.org>
date Wed, 02 Oct 2019 07:35:22 +0900
parents c59eb1560c44
children 8ff1ecfadcd1
line wrap: on
line diff
--- a/mercurial/mail.py	Mon Oct 07 11:52:58 2019 -0400
+++ b/mercurial/mail.py	Wed Oct 02 07:35:22 2019 +0900
@@ -168,9 +168,10 @@
 def _sendmail(ui, sender, recipients, msg):
     '''send mail using sendmail.'''
     program = ui.config(b'email', b'method')
-    stremail = lambda x: (
-        procutil.quote(stringutil.email(encoding.strtolocal(x)))
-    )
+
+    def stremail(x):
+        return procutil.shellquote(stringutil.email(encoding.strtolocal(x)))
+
     cmdline = b'%s -f %s %s' % (
         program,
         stremail(sender),