`hg pull -u` giving TypeError
This bug is happening in setuptools_scm test only for hg-git 1.0.
There is a hg pull -u
from a local Git repo and we get:
** unknown exception encountered, please report by visiting
** https://mercurial-scm.org/wiki/BugTracker
** Python 3.9.13 | packaged by conda-forge | (main, May 27 2022, 16:58:50) [GCC 10.3.0]
** Mercurial Distributed SCM (version 5.6)
** Extensions loaded: churn, extdiff, rebase, absorb, evolve, topic, purge, graphlog, hggit
Traceback (most recent call last):
File "/data0/opt/miniconda3/condabin/app/hg", line 43, in <module>
dispatch.run()
File "/data0/opt/miniconda3/envs/_env_mercurial/lib/python3.9/site-packages/mercurial/dispatch.py", line 113, in run
status = dispatch(req)
File "/data0/opt/miniconda3/envs/_env_mercurial/lib/python3.9/site-packages/mercurial/dispatch.py", line 303, in dispatch
ret = _runcatch(req) or 0
File "/data0/opt/miniconda3/envs/_env_mercurial/lib/python3.9/site-packages/mercurial/dispatch.py", line 479, in _runcatch
return _callcatch(ui, _runcatchfunc)
File "/data0/opt/miniconda3/envs/_env_mercurial/lib/python3.9/site-packages/mercurial/dispatch.py", line 488, in _callcatch
return scmutil.callcatch(ui, func)
File "/data0/opt/miniconda3/envs/_env_mercurial/lib/python3.9/site-packages/mercurial/scmutil.py", line 153, in callcatch
return func()
File "/data0/opt/miniconda3/envs/_env_mercurial/lib/python3.9/site-packages/mercurial/dispatch.py", line 469, in _runcatchfunc
return _dispatch(req)
File "/data0/opt/miniconda3/envs/_env_mercurial/lib/python3.9/site-packages/mercurial/dispatch.py", line 1232, in _dispatch
return runcommand(
File "/data0/opt/miniconda3/envs/_env_mercurial/lib/python3.9/site-packages/mercurial/dispatch.py", line 917, in runcommand
ret = _runcommand(ui, options, cmd, d)
File "/data0/opt/miniconda3/envs/_env_mercurial/lib/python3.9/site-packages/mercurial/dispatch.py", line 1244, in _runcommand
return cmdfunc()
File "/data0/opt/miniconda3/envs/_env_mercurial/lib/python3.9/site-packages/mercurial/dispatch.py", line 1230, in <lambda>
d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
File "/data0/opt/miniconda3/envs/_env_mercurial/lib/python3.9/site-packages/mercurial/util.py", line 1867, in check
return func(*args, **kwargs)
File "/data0/opt/miniconda3/envs/_env_mercurial/lib/python3.9/site-packages/mercurial/util.py", line 1867, in check
return func(*args, **kwargs)
File "/data0/opt/miniconda3/envs/_env_mercurial/lib/python3.9/site-packages/hgext3rd/evolve/__init__.py", line 562, in wrapmayobsoletewc
res = origfn(ui, repo, *args, **opts)
File "/data0/opt/miniconda3/envs/_env_mercurial/lib/python3.9/site-packages/mercurial/util.py", line 1867, in check
return func(*args, **kwargs)
File "/data0/opt/miniconda3/envs/_env_mercurial/lib/python3.9/site-packages/mercurial/util.py", line 1867, in check
return func(*args, **kwargs)
File "/data0/opt/miniconda3/envs/_env_mercurial/lib/python3.9/site-packages/hgext/rebase.py", line 2154, in pullrebase
ret = orig(ui, repo, *args, **opts)
File "/data0/opt/miniconda3/envs/_env_mercurial/lib/python3.9/site-packages/mercurial/util.py", line 1867, in check
return func(*args, **kwargs)
File "/data0/opt/miniconda3/envs/_env_mercurial/lib/python3.9/site-packages/mercurial/commands.py", line 5330, in pull
modheads = exchange.pull(
File "/data0/opt/miniconda3/envs/_env_mercurial/lib/python3.9/site-packages/hggit/util.py", line 95, in inner
return f(*args, **kwargs)
File "/data0/opt/miniconda3/envs/_env_mercurial/lib/python3.9/site-packages/hggit/gitrepo.py", line 191, in exchangepull
pullop.cgresult = repo.githandler.fetch(remote, heads)
File "/data0/opt/miniconda3/envs/_env_mercurial/lib/python3.9/site-packages/hggit/git_handler.py", line 363, in fetch
imported = self.import_git_objects(
File "/data0/opt/miniconda3/envs/_env_mercurial/lib/python3.9/site-packages/hggit/git_handler.py", line 1047, in import_git_objects
self.update_hg_bookmarks(remote_names, refs)
File "/data0/opt/miniconda3/envs/_env_mercurial/lib/python3.9/site-packages/hggit/git_handler.py", line 1858, in update_hg_bookmarks
self.ui.status(_("adding bookmark %s\n") % bm)
File "/data0/opt/miniconda3/envs/_env_mercurial/lib/python3.9/site-packages/mercurial/ui.py", line 1753, in status
self._writemsg(self._fmsgout, type=b'status', *msg, **opts)
File "/data0/opt/miniconda3/envs/_env_mercurial/lib/python3.9/site-packages/mercurial/ui.py", line 1240, in _writemsg
_writemsgwith(self._write, dest, *args, **opts)
File "/data0/opt/miniconda3/envs/_env_mercurial/lib/python3.9/site-packages/mercurial/ui.py", line 2375, in _writemsgwith
write(dest, *args, **opts)
File "/data0/opt/miniconda3/envs/_env_mercurial/lib/python3.9/site-packages/mercurial/ui.py", line 1178, in _write
self._writenobuf(dest, *args, **opts)
File "/data0/opt/miniconda3/envs/_env_mercurial/lib/python3.9/site-packages/mercurial/ui.py", line 1185, in _writenobuf
msg = b''.join(args)
TypeError: sequence item 0: expected a bytes-like object, str found
The content of args
is ("adding bookmark b'master'\n",)
.
Note that I only get the error in the test (i.e. when hg is run from Python with subprocess.run). If I run hg pull -u
in the testing repo, it works.