Mercurial > public > mercurial-scm > hg
comparison hgext/patchbomb.py @ 52388: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 | 2bf9458cede3 |
comparison
equal
deleted
inserted
replaced
52387:648c96d6fa68 | 52388:aa31c8566fb8 |
---|---|
407 The body can be obtained either from the command line option or entered by | 407 The body can be obtained either from the command line option or entered by |
408 the user through the editor. | 408 the user through the editor. |
409 """ | 409 """ |
410 ui = repo.ui | 410 ui = repo.ui |
411 if opts.get('desc'): | 411 if opts.get('desc'): |
412 body = open(opts.get('desc')).read() | 412 body = open(opts.get('desc', 'rb')).read() |
413 else: | 413 else: |
414 ui.write( | 414 ui.write( |
415 _(b'\nWrite the introductory message for the patch series.\n\n') | 415 _(b'\nWrite the introductory message for the patch series.\n\n') |
416 ) | 416 ) |
417 body = ui.edit( | 417 body = ui.edit( |