[Bug 6250] New: `TypeError: must be str or None, not bytes` in histedit.py:geteditcomment

mercurial-bugs at mercurial-scm.org mercurial-bugs at mercurial-scm.org
Wed Jan 8 18:27:37 EST 2020


https://bz.mercurial-scm.org/show_bug.cgi?id=6250

            Bug ID: 6250
           Summary: `TypeError: must be str or None, not bytes` in
                    histedit.py:geteditcomment
           Product: Mercurial
           Version: 5.2.1
          Hardware: PC
                OS: Mac OS
            Status: UNCONFIRMED
          Severity: feature
          Priority: wish
         Component: histedit
          Assignee: bugzilla at mercurial-scm.org
          Reporter: ncalexander+mercurial at gmail.com
                CC: mercurial-devel at mercurial-scm.org
    Python Version: ---

When running under Emacs (on macOS), I see a Python 2/3 bytes issue:
```
$ /usr/local/bin/hg --config diff.git=Off --config ui.merge=:merge histedit
--rev c27272de711597e27754913cb6920f1b77cbdb27
** Unknown exception encountered with possibly-broken third-party extension
evolve
** which supports versions 5.1 of Mercurial.
** Please disable evolve and try your action again.
** If that fixes the bug please report it to https://bz.mercurial-scm.org/
** Python 3.7.6 (default, Dec 30 2019, 19:38:28) [Clang 11.0.0
(clang-1100.0.33.16)]
** Mercurial Distributed SCM (version 5.2.2)
** Extensions loaded: absorb, histedit, purge, rebase, strip, evolve,
fsmonitor, blackbox, firefoxtree, push-to-try, clang-format
Traceback (most recent call last):
  File "/usr/local/bin/hg", line 36, in <module>
    dispatch.run()
  File
"/usr/local/Cellar/mercurial/5.2.2/lib/python3.7/site-packages/mercurial/dispatch.py",
line 111, in run
    status = dispatch(req)
  File
"/usr/local/Cellar/mercurial/5.2.2/lib/python3.7/site-packages/mercurial/dispatch.py",
line 250, in dispatch
    ret = _runcatch(req) or 0
  File
"/usr/local/Cellar/mercurial/5.2.2/lib/python3.7/site-packages/mercurial/dispatch.py",
line 424, in _runcatch
    return _callcatch(ui, _runcatchfunc)
  File
"/usr/local/Cellar/mercurial/5.2.2/lib/python3.7/site-packages/mercurial/dispatch.py",
line 433, in _callcatch
    return scmutil.callcatch(ui, func)
  File
"/usr/local/Cellar/mercurial/5.2.2/lib/python3.7/site-packages/mercurial/scmutil.py",
line 177, in callcatch
    return func()
  File
"/usr/local/Cellar/mercurial/5.2.2/lib/python3.7/site-packages/mercurial/dispatch.py",
line 414, in _runcatchfunc
    return _dispatch(req)
  File
"/usr/local/Cellar/mercurial/5.2.2/lib/python3.7/site-packages/mercurial/dispatch.py",
line 1174, in _dispatch
    lui, repo, cmd, fullargs, ui, options, d, cmdpats, cmdoptions
  File
"/usr/local/Cellar/mercurial/5.2.2/lib/python3.7/site-packages/mercurial/dispatch.py",
line 862, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File
"/usr/local/Cellar/mercurial/5.2.2/lib/python3.7/site-packages/mercurial/dispatch.py",
line 1185, in _runcommand
    return cmdfunc()
  File
"/usr/local/Cellar/mercurial/5.2.2/lib/python3.7/site-packages/mercurial/dispatch.py",
line 1171, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
  File
"/usr/local/Cellar/mercurial/5.2.2/lib/python3.7/site-packages/mercurial/util.py",
line 1843, in check
    return func(*args, **kwargs)
  File
"/usr/local/Cellar/mercurial/5.2.2/lib/python3.7/site-packages/hgext/histedit.py",
line 1836, in histedit
    return _texthistedit(ui, repo, *freeargs, **opts)
  File
"/usr/local/Cellar/mercurial/5.2.2/lib/python3.7/site-packages/hgext/histedit.py",
line 1844, in _texthistedit
    _histedit(ui, repo, state, *freeargs, **opts)
  File
"/usr/local/Cellar/mercurial/5.2.2/lib/python3.7/site-packages/hgext/histedit.py",
line 1967, in _histedit
    _newhistedit(ui, repo, state, revs, freeargs, opts)
  File
"/usr/local/Cellar/mercurial/5.2.2/lib/python3.7/site-packages/hgext/histedit.py",
line 2212, in _newhistedit
    comment = geteditcomment(ui, node.short(root), node.short(topmost))
  File
"/usr/local/Cellar/mercurial/5.2.2/lib/python3.7/site-packages/hgext/histedit.py",
line 327, in geteditcomment
    lines = (intro % (first, last)).split(b'\n') + actions + hints
TypeError: must be str or None, not bytes
Hg exited abnormally with code 1.
```
This reproduces under 5.2.1 and 5.2.2 (both installed via `brew`).  This does
not reproduce within a shell; I get the curses UI.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list