changeset 52420:aa31c8566fb8

patchbomb: fix a py3 crash if `--desc` is provided `mail.mimeencode()` definitely wants the body of the message to be bytes, so read the file that way.
author Matt Harbison <matt_harbison@yahoo.com>
date Thu, 05 Dec 2024 13:00:59 -0500
parents 648c96d6fa68
children aa3261b40492
files hgext/patchbomb.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/patchbomb.py	Thu Dec 05 12:54:57 2024 -0500
+++ b/hgext/patchbomb.py	Thu Dec 05 13:00:59 2024 -0500
@@ -409,7 +409,7 @@
     """
     ui = repo.ui
     if opts.get('desc'):
-        body = open(opts.get('desc')).read()
+        body = open(opts.get('desc', 'rb')).read()
     else:
         ui.write(
             _(b'\nWrite the introductory message for the patch series.\n\n')